HP RPG/XL Programmer's Guide (30318-90001)

1: 8
1A All data areas are initialized. This includes compile-time
tables and arrays and the user date (UDATE) fields obtained from
the system. User indicators (U1-U8) are fetched from the
specified source. The Local Data Area (LDA) is initialized with
the contents of LDAFILE, if specified. The 1P and L0 indicators
are turned on. All files, including TurboIMAGE databases and
data sets, are opened unless the program has been suspended by
the JCW RPGSUSP (see "End-of-Job Processing", Step E-2B).
Preexecution-time tables and arrays are loaded into the data
area.
1B If forms alignment is requested, the first output line for each
print file conditioned by 1P is printed. The first-page heading
records are then written to the specified files.
1C A record is read from each input (primary and secondary) file.
The matching and control fields and the record indicator for
each file are identified.
2 Heading and Detail-Time Output
This is the beginning of the main logic cycle.
2A RPG writes all heading (except those conditioned by the 1P
indicator) and detail lines whose conditions are satisfied. It
turns on the appropriate overflow indicator (if used), if the
overflow line is reached, and it turns off any overflow
indicators that were already processed. It performs overflow
processing if Fetch Overflow is specified and the overflow
indicator is assigned and turned on.
2B If overflow processing was performed by the previous pass
through the cycle or by Fetch Overflow, turn off the overflow
indicator. If the overflow indicator was turned on because
Fetch Overflow was specified and the overflow line was reached
during detail calculations in the previous cycle (or during
detail output time in the current cycle), leave the overflow
indicator on (you can use the overflow indicator to condition
Calculation Specifications during the current cycle).
2C If a halt indicator (H0-H9) is on, control goes to "Run-Time
Error Processing", Step E-1.
2D The first-page indicator (1P) and the control-level indicators
(L1-L9) are turned off. The L0 indicator is turned on.
2E If this is the first time through the logic cycle, control skips
to Step 4A.
2F All record-identifying indicators are turned off.
2G If the last-record (LR) indicator is on, control skips to Step
6B.
3 Record Input
3A If there are no primary or secondary files defined in the
program, control skips to Step 6A. (If there are no primary or
secondary files, the program loops indefinitely unless the
program contains Calculation Specifications that turn LR on.)
3B If the file is not an update or combined file and it contains
look-ahead fields, control skips to Step 3G. (A record from the
file was read before detail Calculation Specifications were
performed in the previous cycle.)
3C If there are spread records defined for an input file and there
are more fields to be processed before reading the next record,
control skips to Step 4A.
3D A record is read from the last file processed. If this file is
retrieved using a Record Address File, the data in the RAF
defines the record to be selected.
3E If the file just read is at end-of-file, control skips to Step