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

1: 4
Control-Level (L1-L9) Lets you sense and perform total operations,
such as printing part number totals on a
report.
First-Page (1P) Lets you sense when the first record is
processed and lets you perform first record
processing.
Function Key (F1-F9) Lets you use function keys with VPLUS and with
the Calculation Specification operations, SET,
DSPLY and DSPLM.
General (01-99) Lets you control operations on Input,
Calculation and Output Specifications.
Field indicators are a special kind of general
indicator used with Input Specifications. They
test input fields for plus, minus, zero or
blanks. Field indicators are turned on after
total-time processing and remain on until after
the next total-time cycle.
Halt (H1-H9) Stops an RPG program at the end of the current
logic cycle. You can stop an RPG program based
on record codes, field and result values. Once
the program is stopped, the operator can resume
it by entering an appropriate error response.
To avoid halts, you can enter pre-responses to
individual errors using the Header
Specification.
Last-Record (LR) Lets you sense when the last record is
processed and lets you perform last record
processing.
Overflow (OA-OG, OV) Signals the logical end of the printed page.
Overflow indicators are turned on when the
overflow line is printed. Sensing overflow
lets you perform output operations at the
bottom of the current page or at the top of the
next page.
Matching Record (MR) Lets you select the processing order of input
records when using more than one input file.
This indicator is turned on after total-time
processing in the logic cycle is performed.
User (U1-U8) Allows communication between RPG programs.
User indicators are read into the program when
it starts and are passed to the next RPG
program upon termination. For more information
on user indicators see the "Communicating
Switches" section of Chapter 8.
More About the RPG Logic Cycle
The following sections in this chapter give details about how the RPG
logic cycle works and how indicators are used. Use this section when you
have specific questions about how a particular RPG feature is
implemented.
The Primary Steps in the RPG Logic Cycle
When an RPG program is first executed, certain initialization and
housekeeping operations (described under Step 1 below) are performed.
Then the main RPG cycle begins (Steps 2-8). Steps 2 through 8 are
repeated for each set of input records. Figure 1-3 diagrams these steps:
Step Description
1 Pre-Cycle Initialization and Housekeeping
RPG performs certain preliminary functions once before the main
logic cycle begins. During these operations, all data areas are