Summary of Indicators

Table 22 and Table 23 show summaries of where RPG IV indicators are defined, what the valid entries are, where the indicators are used, and when the indicators are set on and off. Table 23 indicates the primary condition that causes each type of indicator to be set on and set off by the RPG IV program. Function Key Indicators lists the function key indicators and the corresponding function keys.

Table 22. Indicator Entries and Uses
Where Defined/Used 01-99 1P H1-H9 L1-L9 LR MR OA-OG OV U1-U8 KA-KN KP-KY RT
User Defined Overflow indicator, file description specifications, OFLIND keyword X X
Record identifying indicator input specifications, positions 21-22 X X X X X X
Control level, input specifications, positions 63-64 X
Field level, input specifications, positions 69-74 X X X X
Resulting indicator, calculation specifications, positions 71-76 X X X X X1 X X2 X
RPG Defined Internal Indicator X X X X
External Indicator X
Used File conditioning, file description specifications X
File record relation, input specifications 67-683 X X X X X X
Control level, calculation specifications, positions 7-8 X X
Conditioning indicators, calculation specifications, positions 9-11 X X X X X X X X X
Output indicators, output specifications, positions 21-29 X X4 X X X X X X X X
Notes:
  1. The overflow indicator must be defined on the file description specification first.
  2. KA through KN and KP through KY can be used as resulting indicators only with the SETOFF operation.
  3. Only a record identifying indicator from a main or OR record can be used to condition a control or match field. L1 or L9 cannot be used to condition a control or match field.
  4. The 1P indicator is allowed only on heading and detail lines.

Table 23. When Indicators Are Set On and Off by the RPG IV Logic Cycle
Type of Indicator Set On Set Off
Overflow When printing on or spacing or skipping past the overflow line.
OA-OG, OV:  After the following heading
and detail lines are completed,
or after the file is opened unless
the H-specification keyword
OPENOPT(*NOINZOFL) is used.
01-99:  By the user.
Record identifying When specified primary / secondary record has been read and before total calculations are processed; immediately after record is read from a full procedural file. Before the next primary/secondary record is read during the next processing cycle.
Control level When the value in a control field changes. All lower level indicators are also set on. At end of following detail cycle.
Field indicator By blank or zero in specified fields, by plus in specified field, or by minus in specified field. Before this field status is to be tested the next time.
Resulting When the calculation is processed and the condition that the indicator represents is met. The next time a calculation is processed for which the same indicator is specified as a resulting indicator and the specified condition is not met.
Function key When the corresponding function key is pressed for WORKSTN files and at subsequent reads to associated subfiles. By SETOFF or move fields logic for a WORKSTN file.
External U1-U8 By CL command prior to beginning the program, or when used as a resulting or a field indicator.
Note:
The value of the external indicators is set from the job switches during initialization. For a cycle module, it is done during the *INIT phase of the cycle; for other modules, it is done only once, when the first procedure in the module is called.
By CL command prior to beginning the program, or when used as a resulting or when used as a resulting or a field indicator.
H1-H9 As specified by programmer. When the continue option is selected as a response to a message, or by the programmer.
RT As specified by programmer. When the program is called again.
Internal Indicators 1P At beginning of processing before any input records are read. Before the first record is read.
LR After processing the last primary/secondary record of the last file or by the programmer. At the beginning of processing, or by the programmer.
MR If the match field contents of the record of a secondary file correspond to the match field contents of a record in the primary file. When all total calculations and output are completed for the last record of the matching group.


[ Top of Page | Previous Page | Next Page | Contents | Index ]