When assigning resulting indicators, remember the following:
- Resulting indicators cannot be used when the result field refers
to an entire array.
- If the same indicator is used to test the result of more than
one operation, the last operation processed determines the setting
of the indicator.
- When L1 through L9 indicators are used as resulting indicators
and are set on, lower level indicators are not set on. For example,
if L8 is set on, L1 through L7 are not set on.
- If H1 through H9 indicators are set on when used as resulting
indicators, the program halts unless the halt indicator is set off
prior to being checked in the program cycle. (See RPG Cycle and other implicit Logic).
- The same indicator can be used to test for more than one condition
depending on the operation specified.
Figure 1. Resulting Indicators Used to Condition
Operations*...1....+....2....+....3....+....4....+....5....+....6....+....7...
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq..
*
* Two resulting indicators are used to test for the different
* conditions in a subtraction operation. These indicators are
* used to condition the calculations that must be processed for
* a payroll job. Indicator 10 is set on if the hours worked (HRSWKD)
* are greater than 40 and is then used to condition all operations
* necessary to find overtime pay. If Indicator 20 is not on
* (the employee worked 40 or more hours), regular pay based on a
* 40-hour week is calculated.
*
C HRSWKD SUB 40 OVERTM 3 01020
*
C N20PAYRAT MULT (H) 40 PAY 6 2
C 10OVERTM MULT (H) OVRRAT OVRPAY 6 2
C 10OVRPAY ADD PAY PAY
*
* If indicator 20 is on (employee worked less than 40 hours), pay
* based on less than a 40-hour week is calculated.
C 20PAYRAT MULT (H) HRSWKD PAY
*