Handling selectable repeat separators
Some repeatable items in the SELECT statement syntax have a repeat
separator that you can select (rather than a constant such as a comma).
For example, the expression clause as shown in Example
of a selectable repeat separator uses an operator (oper) as
a repeat separator.
To show how to handle selectable repeat separators, we'll use an
example. To generate the following expression clause:
AMT1 + AMT2 - AMT3
where
the columns AMT1
, AMT2
, and AMT3
are
three repeat items, and +
and -
are
the two repeat separators, perform the following steps:- Move the cursor to the column element and press Enter. A pop-up panel is displayed.
- Type
AMT1
and press the InsRpt function key (F5). AMT1 is added to the clause:AMT1
- Move the cursor to the oper repeat separator and press the InsRpt function key (F5). A list of valid repeat separators is displayed.
- Move the cursor to the
+
repeat separator and press Enter.+
is added to the clause:AMT1 +
- Press the Exit function key (F3). The syntax for the expression clause is redisplayed.
- Move the cursor to the column element and press Enter. A pop-up panel is displayed.
- Type
AMT2
and press the InsRpt function key (F5). AMT2 is added to the clause:AMT1 + AMT2
- Move the cursor to the oper repeat separator and press the InsRpt function key (F5). A list of valid repeat separators is displayed.
- Move the cursor to the
-
repeat separator and press Enter.-
is added to the clause:AMT1 + AMT2 -
- Press the Exit function key (F3). The syntax for the expression clause is redisplayed.
- Move the cursor to the column element and press Enter. A pop-up panel is displayed.
- Type
AMT3
and press the InsRpt function key (F5). AMT3 is added to the clause:AMT1 + AMT2 - AMT3
Note: The repeat separator is associated with the repeat item it follows.
When the last repeat item is current, you cannot edit the repeat separator.