HP 3000 Manuals

Indicators (Columns 9-17) [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation


HP RPG/iX Reference Manual

Indicators (Columns 9-17) 

The Indicator field is composed of subfields that let you enter up to
three indicators for conditioning the operation.  These indicators are
used in addition to the indicators entered in the Control Level Field
(columns 7-8).

          Table 8-2.  Indicators (Columns 9-17) 

-----------------------------------------------------------------------------------------------
|                   |                   |                                                     |
|      Column       |       Value       |                     Description                     |
|                   |                   |                                                     |
-----------------------------------------------------------------------------------------------
|                   |                   |                                                     |
| Not:  (columns 9, |         N         | The indicator in the indicators subfield (below)    |
| 12, 15)           |                   | must be OFF to condition the operation.             |
|                   |                   |                                                     |
|                   |       blank       | The indicator in the indicators subfield (below)    |
|                   |                   | must be ON to condition the operation.              |
|                   |                   |                                                     |
| Indicators:       |       01-99       | General indicators used elsewhere in the program.   |
| (columns 10-11,   |                   |                                                     |
| 13-14, 16-17)     |                   |                                                     |
|                   |                   |                                                     |
|                   |       F0-F9       | Function key indicators.                            |
|                   |                   |                                                     |
|                   |      KA-KN,       | Command key indicators.                             |
|                   |       KP-KY       |                                                     |
|                   |                   |                                                     |
|                   |       H0-H9       | Halt indicators.                                    |
|                   |                   |                                                     |
|                   |       L0-L9       | Control-level indicators.                           |
|                   |                   |                                                     |
|                   |        LR         | Last record indicator.                              |
|                   |                   |                                                     |
|                   |        MR         | Matching-record indicator.                          |
|                   |                   |                                                     |
|                   |     OA-OG,OV      | Overflow indicators.                                |
|                   |                   |                                                     |
|                   |       U1-U8       | User indicators.                                    |
|                   |                   |                                                     |
|                   |        1P         | First page indicator.                               |
|                   |                   |                                                     |
|                   |       blank       | The operation is performed for every input record   |
|                   |                   | if the Control Level Field does not contain L0-L9   |
|                   |                   | or SR.                                              |
|                   |                   |                                                     |
| (column 11 only)  |         *         | The operation is conditioned by the same indicators |
|                   |                   | as the previous Calculation Specification.          |
|                   |                   |                                                     |
-----------------------------------------------------------------------------------------------

All indicator settings (in addition to what is specified in the Control
Level Field) must be satisfied to perform the operation.  You can enter
AN(D) and OR lines to use more than three indicators to condition an
operation (see "Control Level Field" in this chapter).

When conditioning operations with indicators, be sure you understand how
they are used in the RPG logic cycle (see the HP RPG Programmer's Guide).

When using the Indicator Field, you can:

   *   Use any indicator entered in the Record
       Indicator/Look-Ahead/Trailer/Data Structure Field (columns 19-20)
       of the Input Specifications to condition operations for certain
       record types.

   *   Use any indicator entered in the Field Indicators Field (columns
       65-70) of the Input Specification to condition operations that use
       fields that meet certain requirements.

   *   Use any indicator entered in the Resulting Indicators Field
       (columns 54-59) to condition operations based on the results of
       previous operations.

H0-H9 (Halt Indicators) 

The halt indicators cause the operation to be stopped or skipped when
there are input data errors.  You can also use them to perform an
operation only under certain error conditions.  To use a halt indicator
in this field, you must have entered it in the Field Indicators Field
(columns 65-70) of an Input Specification or in the Resulting Indicators
Field (columns 54-59) of a previously executed Calculation Specification.

L0-L9 (Control-Level Indicators) 

The control-level indicators cause the operation to be performed at
detail time only for the first record of a new control group (either the
field associated with this indicator changes or a field associated with
an indicator of higher rank changes).  The indicator must have been
entered in either the Control Level Field (columns 59-60) of an Input
Specification or in the Resulting Indicators Field (columns 54-59) of a
previously executed Calculation Specification.

When you enter a control-level indicator in this field, do not enter it
in the Control Level Field (columns 7-8).

LR (Last-record indicator) 

The last-record indicator causes the operation to be performed at
end-of-program.  RPG turns it ON automatically when the last input record
is read.  You can turn it ON yourself by entering it in the Resulting
Indicators Field (columns 54-59) of another specification.

MR (Matching-Record Indicator) 

The matching-record indicator causes the operation to be performed when
matching fields are the same for the current input records.  You must
define matching fields in the Matching/Chaining Fields (columns 61-62) in
the Input Specification.

If you entered a control-level indicator (L1-L9) in the Control Level
Field (columns 7-8), MR is turned ON when a matching condition occurs for
the previous record, not the record that caused the control break.

OA-OG, OV (Overflow Indicators) 

The overflow indicators cause the operation to be performed when page
overflow occurs.  To associate the indicator with page overflow, you must
enter it in the Overflow Indicators Field (columns 33-34) of the File
Description Specification.

U1-U8 (User Indicators) 

The user indicators indicators cause the operation to be executed when
they are turned ON. You can turn the user indicators on yourself with the
SETON operation.  You get the initial settings (ON or OFF) of these
indicators in three different ways.

   *   By prompting the operator.

   *   By taking values from the system job control word (JCW).

   *   By taking values from a file.

* (Column 11 Only) 

If you use the same indicators for several consecutive operations, you do
not have to repeat them on each line.  Enter them on the first line, then
enter an asterisk (*) in column 11 on successive lines.

Examples 

Figures 8-4 and 8-5 give two examples for using indicators to condition
Calculation Specification operations.  In figure 8-4, the operation is
performed at total time when indicators L6, 01, and 03 are ON and 02 is
OFF.
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|              _______________________________________________________            |
|                                                                                 |
|            CL6 01N02 03FAC1      ADD  FAC2      FACX    50                      |
|                                                                                 |
|                                                                                 |
___________________________________________________________________________________

          Figure 8-4.  Using Four Indicators to Condition a Calculation Specification Operation 

Figure 8-5 shows how an indicator is turned ON, then used to condition a
Calculation Specification operation.  When the field CLASS is blank, the
general indicator 01 turns ON (line 1).  Line 2 performs the ADD
operation only when CLASS is not blank (indicator 01 is turned OFF).
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|              _______________________________________________________            |
|                                                                                 |
|            IINFILE  AA                                                          |
|            I                                                .                   |
|            I                                                .                   |
|     1     I                                       21  25 CLASS           01     |
|                                                                                 |
|            C                      .                                             |
|            C                      .                                             |
|     2     C  N01      SUMA      ADD  SUMB      SUMC    50                       |
|                                                                                 |
|                                                                                 |
|                                                                                 |
___________________________________________________________________________________

          Figure 8-5.  Using One Indicator to Condition a Calculation Specification Operation 



MPE/iX 5.0 Documentation