HP 3000 Manuals

The Output Specification Fields [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation


HP RPG/iX Reference Manual

The Output Specification Fields 

The fields you can use in the Output Specification are described in the
sections which follow in this chapter.  Each field has a unique name and
occupies specific columns in the specification.

Sequence Number (Columns 1-5) 

The sequence number field contains the source record sequence number,
described in Chapter 2.

Specification Type (Column 6) 

The specification type field contains an O to identify this as an Output
Specification.

Record Description Fields (Columns 7-31) 

The record description fields describe the record types contained in the
output, update, or combined file.

A good programming practice is to group all Output Specifications for a
file together.  Define the first record type by entering the appropriate
Record Description Fields and leaving columns 32-70 blank.  You may
follow this line by one or more AND or OR lines (see the AND/OR Field,
columns 14-16).  Next, enter one or more specifications that describe the
fields for the record type (see the Field Description Fields, columns
32-70).  Repeat this specification sequence until all record types are
defined.

Example 

Figure 9-2  shows three output records together with their field
descriptions.  Line 1 contains the Record Description Fields for the file
OUT. Lines 3 and 6 show the Record Description Fields for two records in
the file OUTDIR. Lines 2, 4-5, and 7 contain the Field Description Fields
for these records.
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|              _______________________________________________________            |
|                                                                                 |
|     1     OOUT     H                                                            |
|     2     O                                   60 "REPORT - 1988"                |
|            O                                 .                                  |
|            O                                 .                                  |
|     3     OOUTDIR  DADD     07                                                  |
|     4     O                         FIELDA     5                                |
|     5     O                         FIELDB    10                                |
|     6     O        TADD     L1                                                  |
|     7     O                         FIELDC    15                                |
|                                                                                 |
|                                                                                 |
___________________________________________________________________________________

          Figure 9-2.  Entering Output Specification for Two Files 

File Name (Columns 7-14).   

The file name field names the file to which this and subsequent Output
Specifications apply.  Enter the name of an output, combined, or update
file defined by a File Description Specification.

-----------------------------------------------------------------------------------------
|                                           |                                           |
|               Columns 7-14                |                Description                |
|                                           |                                           |
-----------------------------------------------------------------------------------------
|                                           |                                           |
| Valid file name.  (File names contain     | The name of the output, update, or        |
| from one to eight characters, beginning   | combined file being described by this     |
| with a letter.  The remaining characters  | Output Specification.                     |
| can be letters or digits.  Embedded       |                                           |
| blanks are not allowed.)                  |                                           |
|                                           |                                           |
-----------------------------------------------------------------------------------------

If you enter several Record Description lines for the same file, you only
need to enter the file name on the first one.  The file name remains in
effect until a new name is encountered.

If the file is an output file, RPG creates it with the characteristics
shown in Table 9-1 .  You can override some of these characteristics
using the MPE/iX FILE command.

          Table 9-1.  Output File Characteristics 

--------------------------------------------------------------------------------------------
|                           |                                                              |
| FOPEN                     |                                                              |
|                           |                                                              |
| Formal File Designator:   | File name or DSNAME.                                         |
|                           |                                                              |
| Foptions:                 |                                                              |
|                           |                                                              |
|     Domain:               | The file is opened as an OLD (11) file.  If this fails, it   |
|                           | is opened as a NEW file.                                     |
|                           |                                                              |
|     ASCII/Binary:         | ASCII (1).                                                   |
|                           |                                                              |
|     Default File          | Same as formal designator (000).                             |
| Designator:               |                                                              |
|                           |                                                              |
|     Record Format:        | Fixed length (00) or variable length (01).                   |
|                           |                                                              |
|     Carriage Control:     | NOCCTL (0) if no carriage-control used, CCTL (1) if          |
|                           | carriage-control used.                                       |
|                           |                                                              |
|     Label Option:         | Standard label processing (0).                               |
|                           |                                                              |
|     Disallow File         | Allow (0).                                                   |
| Equation:                 |                                                              |
|                           |                                                              |
| Aoptions:                 |                                                              |
|                           |                                                              |
|     Access Type:          | Input files:  0 Output files:    Regular:  1    Chain:  2    |
|                           |                                                              |
|                           |    Append Only:  3    Combined:  4    Update:  5             |
|                           |                                                              |
--------------------------------------------------------------------------------------------

          Table 9-1.  Output File Characteristics (Continued) 

--------------------------------------------------------------------------------------------
|                           |                                                              |
|     Multirecord Access:   | No (0).                                                      |
|                           |                                                              |
|     Dynamic Locking:      | No (0) if no LOCK File Description Continuation line;        |
|                           | otherwise, yes (1).                                          |
|                           |                                                              |
|     Exclusive:            | Default (00) if no LOCK File Description Continuation line;  |
|                           | otherwise, share (11).                                       |
|                           |                                                              |
|     Inhibit Buffering:    | No (0).                                                      |
|                           |                                                              |
| Record Size:              | As specified in columns 24-27 of the File Description        |
|                           | Specification.  Default:  80 bytes.                          |
|                           |                                                              |

| Device Name:              | As specified in columns 40-46 of the File Description        |
|                           | Specification.  Default:  DISK.                              |
|                           |                                                              |
| Forms Message:            | If specified, RPG points to a buffer containing blanks,      |
|                           | causing the standard alignment line to print.                |
|                           |                                                              |
| User labels:              | As specified in column 53 of the File Description            |
|                           | Specification.  Default:  none.                              |
|                           |                                                              |
| Blocking Factor:          | As specified in columns 20-23 and 24-27 of the File          |
|                           | Description Specific Default:  1.                            |
|                           |                                                              |
| Number of Buffers:        | Default (2).                                                 |
|                           |                                                              |
| File Size:                | Default (1023).                                              |
|                           |                                                              |
| Number of Extents:        | As specified in columns 68-69 of the File Description        |
|                           | Specification.  Default:  8.                                 |
|                           |                                                              |
| Initial Allocation of     | 1.                                                           |
| Extents:                  |                                                              |
|                           |                                                              |
| File Code:                | 0.                                                           |
|                           |                                                              |
| FCLOSE                    |                                                              |
|                           |                                                              |
|     Disposition:          | No change.                                                   |
|                           |                                                              |
|     Security Code:        | Normal (0)                                                   |
|                           |                                                              |
--------------------------------------------------------------------------------------------

AND/OR (Columns 14-16).   

The AND/OR field lets you specify additional indicators that determine
whether the output record is written.  (Without using AND and OR lines,
the maximum number of indicators that you can use is 3.)  You cannot use
this field to condition individual fields in the output record.

------------------------------------------------------------------------------------------
|                   |                                                                    |
|   Columns 14-16   |                            Description                             |
|                   |                                                                    |
------------------------------------------------------------------------------------------
|                   |                                                                    |
|        AND        | Identifies this Input Specification as an AND line.                |
|                   |                                                                    |
|        OR         | Identifies this Input Specification as an OR line.                 |
|                   |                                                                    |
------------------------------------------------------------------------------------------

You can intermix AND and OR lines.  (The total number of AND and OR lines
that you can use for each output record is 20.)  Each OR line begins a
new decision path (see the example which follows).

When you use AND lines, all indicators that you enter in the Output
Indicators Field (columns 23-31) must be satisfied before the record is
written.  When entering AND lines, follow these steps:

   1.  Make sure that the previous Output Specification contains three
       indicators in the Output Indicators Field (columns 23-31).

   2.  Enter AND in columns 14-16 and up to three indicators in the
       Output Indicators Field.  Leave columns 17-22 blank.

       If this AND line is followed by other AND lines and you want to
       use Fetch Overflow or Release (the Fetch Overflow/Release Field,
       column 16) with any of them, you must enter F or R on this line
       only (the first AND line).

   3.  Continue entering AND lines (or OR lines) until you've entered all
       of the conditions (indicators) for writing the record.

When OR lines are executed, the record is written when all of the
indicators in the Output Indicators Field (columns 23-31) are satisfied.
When the OR line is followed by one or more AND lines, the record is also
written when all of the indicators in the AND lines are satisfied.  When
you enter OR lines, follow these steps:

   1.  Make sure that if the previous specification is the first Record
       Description line, there is at least one indicator in the Output
       Indicators Field (columns 23-31).

   2.  Enter OR in columns 14-15 and up to three indicators in the Output
       Indicators Field.

       If you want to use different spacing or skipping for records that
       satisfy the OR line indicators, enter the appropriate values in
       the Space Field (columns 17-18) or the Skip Field (columns 19-22),
       or both.  If you leave these fields blank, the spacing and
       skipping specified for the previous specification is used.

       If you want to use Fetch Overflow or Release (the Fetch
       Overflow/Release Field, column 16), enter F or R on this line but
       not on subsequent AND lines, if there are any.

   3.  Continue entering OR lines (or AND lines) until you're entered all
       of the conditions (indicators) for writing the record.

Example 

Figure 9-3  shows how to use AND and OR lines to condition an output
record.  The record beginning in line 5 is written when:

   *   Indicators 01, 02, and 03 are ON (line 1).

       or 

   *   Indicators 06, 07, 08, and 09 are ON (lines 2, 3).

       or 

   *   Indicators 10 and 11 are ON (line 4).
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|              _______________________________________________________            |
|                                                                                 |
|     1     O        T 2      01 02 03                                            |
|     2     O       OR        06 07 08                                            |
|     3     O       AND       09                                                  |
|     4     O       OR        10 11                                               |
|     5     O                         PAYTOT    10                                |
|                                                                                 |
|                                                                                 |
___________________________________________________________________________________

          Figure 9-3.  Using AND or OR Lines to Condition Record Output 

Type (Column 15).   

The type field specifies when the record is written in the logic cycle.
You can enter one of the following four values:

------------------------------------------------------------------------------------------
|                   |                                                                    |
|     Column 15     |                            Description                             |
|                   |                                                                    |
------------------------------------------------------------------------------------------
|                   |                                                                    |
|         D         | Detail record.                                                     |
|                   |                                                                    |
|         E         | Exception record.                                                  |
|                   |                                                                    |
|         H         | Heading record.                                                    |
|                   |                                                                    |
|         T         | Total record.                                                      |
|                   |                                                                    |
------------------------------------------------------------------------------------------

Within each of the above record types, records are written in the same
order as their specifications are entered.  You can enter all records
together that have the same type (for example, you can place all heading
records for all files together), or you can enter records for each type
consecutively within each file (for example, you can enter heading
records, then detail records, then total records, and finally exception
records for a particular file.)

D 

Detail records are written at detail time in the logic cycle.  They
contain the most basic level of information of all the record types.
Usually, this information is closely related to input data.  It is either
read directly from the input records or is calculated using the input
records.

E 

Exception records are written at detail or total time at the point at
which an EXCPT Calculation Specification operation is encountered.  (The
records are written at total time when conditioned by a control-level
indicator.)  Use exception records for output that occurs infrequently,
under unusual circumstances, or when the number of output records varies
during each logic cycle.

Do not condition exception records for primary and secondary update files
with control-level indicators or with the last-record indicator.  If you
do, the results are unpredictable.

H 

Heading records are written during pre-cycle processing in the logic
cycle.  (To print heading records at other times in the logic cycle,
condition the output record with an overflow indicator.)  Heading records
contain data that generally remains constant, such as report titles and
column headings.  Heading records can contain a page number which is
incremented automatically.

T 

Total records are written at total time in the logic cycle.  They
typically contain totals accumulated from one or more detail records.

Example 

Figure 9-4  shows heading, detail, and total records as they appear on
a report.  The first two lines are heading records containing the date, a
report title, a page number, and column headings.  The detail records are
the unshaded lines containing the division, department, name, and days
absent for each employee.  Total records are shaded and start with
DEPARTMENT and DIVISION. They list the total number of days employees
were absent within each department and division.
_____________________________________________________________________
|                                                                   |
|        DATE   09/15/88    ABSENTEE REPORT               PAGE NO. 1|
|                                                                   |
|                                                                   |
|        DIVISION    DEPARTMENT     EMPLOYEE          DAYS OUT      |
|                                                                   |
|        01          11             BABCOCK, J. D.       2          |
|        01          11             JONES, F. D.         1          |
|        01          11             MASON, M. M.         1          |
|                                                                   |
|        DEPARTMENT  11             TOTALS               4          |
|                                                                   |
|        01          12             MOONEY, J. P.        3          |
|        01          12             POMEROY, G.          2          |
|        01          12             RASKIN, K. T.        1          |
|                                                                   |
|        DEPARTMENT  12             TOTALS               6          |
|        .            .               .                  .          |
|        .            .               .                  .          |
|        .            .               .                  .          |
|                                                                   |
|        DEPARTMENT  20             TOTALS              10          |
|                                                                   |
|        DIVISION     1             TOTALS              53          |
|                                                                   |
|                                                                   |
_____________________________________________________________________

          Figure 9-4.  Output Record Types As They Appear on a Report 

Record Addition/Deletion (Columns 16-18).   

The record addition/deletion field specifies whether the record is to be
added to the output file (ADD) or deleted from it (DEL). Use this field
only with output and update disk files.

--------------------------------------------------------------------------------------------
|                       |                                                                  |
|     Columns 16-18     |                           Description                            |
|                       |                                                                  |
--------------------------------------------------------------------------------------------
|                       |                                                                  |
|          ADD          | Add this record to an update or output file.                     |
|                       |                                                                  |
|          DEL          | Delete this record from an update file.  Use DEL with KSAM and   |
|                       | TurboIMAGE files only.                                           |
|                       |                                                                  |
|         blank         | For sequential or KSAM files, write this record to the beginning |
|                       | of the file; for TurboIMAGE files, insert this record in the     |
|                       | file; for update files, update the current record.               |
|                       |                                                                  |
--------------------------------------------------------------------------------------------

ADD 

When you use ADD with MPE sequential and KSAM files, you must enter ADD
on each record in the file.  You must also enter A in the File Addition
Field (column 66) of the File Description Specification for the file.
(If you omit A for KSAM files, records are added to the file in primary
key sequence.)
[REV BEG]

New records are appended to MPE sequential files.  They are added to KSAM
and TurboIMAGE files in primary key sequence.[REV END]

Fetch Overflow/Release (Column 16).   

The fetch overflow/release field lets you print overflow lines ahead of
pending detail and total lines when the overflow line is reached (Fetch
Overflow).  It also lets you end the processing of a file before the
program terminates normally (Release File).

--------------------------------------------------------------------------------------------
|                       |                                                                  |
|       Column 16       |                           Description                            |
|                       |                                                                  |
--------------------------------------------------------------------------------------------
|                       |                                                                  |
|         blank         | Do not write overflow records at this point, and do not release  |
|                       | the file.                                                        |
|                       |                                                                  |
|    Fetch Overflow:    |                                                                  |
|                       |                                                                  |
|           F           | Write overflow records at this point (by fetching the RPG        |
|                       | Overflow Routine).                                               |
|                       |                                                                  |
|     Release File:     |                                                                  |
|                       |                                                                  |
|           R           | Release the file (close, or close and reopen the file, as shown  |
|                       | in Table 9-1).                                                   |
|                       |                                                                  |
--------------------------------------------------------------------------------------------

F (Fetch Overflow) 

When the overflow line is reached, this option immediately suspends the
printing of pending detail and total records for the file until all
overflow records (those conditioned by overflow indicators) are printed.
Use this field only for print files and files whose output is controlled
by Line Counter Specifications and that contain an indicator in the
Overflow Indicator Field (columns 33-34) of the File Description
Specification.

Normally, when the overflow line is reached, pending detail and total
records for the file are printed and overflow processing begins.
Overflow records are printed and the paper is advanced to top-of-form.
When you use this option, the overflow routine is "fetched" immediately;
pending detail and total lines are printed after the overflow records.
RPG does not automatically advance the paper to top-of-form after
printing the overflow lines.  You must specify this in the Skip Field
(columns 21-22) of a specification that is conditioned by an overflow
indicator.

If you're using OR lines and want to use Fetch Overflow in each of them,
enter F in each OR line.

See the description of the RPG logic cycle in the HP RPG Programmer's 
Guide for details about Fetch Overflow processing.

R (Release File) 

The release file option lets you release the file associated with this
record after the record is written.  If the record has no fields, the
file is released without writing a blank line (or record).  This option
is similar to the CLOSE Calculation Specification operation.

The Release File option works differently for certain file types.  Table
9-2  describes the actions that are performed for them.

          Table 9-2.  Actions Performed - Release File 

--------------------------------------------------------------------------------------------
|                                      |                                                   |
|             Type of File             |                      Actions                      |
|                                      |                                                   |
--------------------------------------------------------------------------------------------
|                                      |                                                   |
| Print file:  Any update, combined,   | The file is closed and then reopened (the output  |
| or output file whose File            | spoolfile is released for printing and a new one  |
| Organization (column 32 of the File  | is created).                                      |
| Description Specification) is not I, |                                                   |
| S, or M; and that uses space and/or  | If a Print file is redirected to disk with an MPE |
| skip entries (columns 17-22) or that | file equation (or with DISK in the Device Class   |
| is opened at run time with the CCTL  | Name Field, columns 40-46, of the File            |
| (Carriage Control) option of the MPE | Description Specification), the disk file is      |
| FILE command; and whose Record       | closed and then reopened in append mode.  All     |
| Addition/Deletion Field (columns     | output is concatenated into one disk file.        |
| 16-18) is blank.                     | Create the disk file using the CCTL (Carriage     |
|                                      | Control) option of the operating system FILE      |
|                                      | command.  This enables you to print the file at a |
|                                      | later time (using FCOPY, for example) with forms  |
|                                      | control.                                          |
|                                      |                                                   |
| WORKSTN file.                        | The WORKSTN file is closed and not reopened.      |
|                                      | This releases the terminal from block mode        |
|                                      | operation, allowing the program to continue       |
|                                      | terminal I/O in non-block mode.  (This operation  |
|                                      | is equivalent to using the Calculation            |
|                                      | Specification CLOSE operation.)                   |
|                                      |                                                   |

| Any other file.                      | The file is closed and not reopened.  This        |
|                                      | operation is the same as the Calculation          |
|                                      | Specification CLOSE operation.                    |
|                                      |                                                   |
--------------------------------------------------------------------------------------------

Space (Columns 17-18).   

The space field lets you space up to three lines before and after
printing the record.  Use this field only for printer or terminal records
or records controlled by Line Counter Specifications.

------------------------------------------------------------------------------------------
|                       |                                                                |
|        Column         |                          Description                           |
|                       |                                                                |
------------------------------------------------------------------------------------------
|                       |                                                                |
|     Before (17):      |                                                                |
|                       |                                                                |
|         blank         | Do not space a line before printing.  If this is a terminal    |
|                       | file, or if the Skip Field (columns 19-22) is blank, single    |
|                       | space before printing.                                         |
|                       |                                                                |
|           0           | Do not space a line before printing.  If this is terminal      |
|                       | file, single space before printing.                            |
|                       |                                                                |
|           1           | Space one line.                                                |
|                       |                                                                |
|           2           | Space two lines.                                               |
|                       |                                                                |
|           3           | Space three lines.                                             |
|                       |                                                                |
|      After (18):      |                                                                |
|                       |                                                                |
|         blank         | Do not space a line after printing.  If the Space and Skip     |
|                       | Fields (columns 17-22) are blank, single space after printing  |
|                       | each record.                                                   |
|                       |                                                                |
|           0           | Do not space a line after printing.                            |
|                       |                                                                |
|           1           | Space one line.                                                |
|                       |                                                                |
|           2           | Space two lines.                                               |
|                       |                                                                |
|           3           | Space three lines.                                             |
|                       |                                                                |
------------------------------------------------------------------------------------------

When you space beyond the overflow line, normal overflow processing takes
place (see the previous field, Fetch Overflow/Release (column 16) for a
description of overflow processing).

The Skip Field (columns 19-22) lets you space to a certain line number or
printer carriage control channel.  When you use this field and the Skip
Field in the same specification, spacing is performed in this order:

   1.  Skip before printing.

   2.  Space before printing.

   3.  Skip after printing.

   4.  Space after printing.

If you use this field and the Skip Field (columns 19-22) for a file, the
file is assumed to be a print file and is written with forms control
information (such as auto page eject).  Additionally, to be considered a
print file, the file must be an output, update, or combined file whose
File Organization Field (column 32 of the File Description Specification)
is not Indexed (I, S, or M) and that is blank in the AND/OR Field
(columns 14-16).

The following actions may take place for print files:

   *   The file is opened using the CCTL (Carriage Control) option.  (See
       the CCTL option of the MPE FILE command.)

   *   Forms positioning is performed if requested by column 41 of the
       Header Specification.

   *   Post spacing and auto page eject directives are set in the output
       spoolfile.

   *   Initial page eject is performed unless suppressed by columns 41-47
       of the Header Specification.

   *   Carriage Control (CCTL) directives are added to the output
       records.

   *   Line counting and channel operations are performed according
       to the Carriage Control Field (column 53) of the Header
       Specification.

   *   Spacing and skipping operations are performed according this field
       and the Skip Field (columns 19-22).

   *   Release file operations are performed if you enter R in the
       Fetch/Overflow Release Field (column 16):  close the output
       spoolfile and then open a new one to receive additional output.
       (Even if a file does not meet the criteria for print files, you
       can perform these release file operations by entering an MPE FILE
       command with the CCTL option.)

Skip (Columns 19-22).   

The skip field lets you skip to a particular line or logical printer
channel before and after printing the record.

------------------------------------------------------------------------------------------
|                       |                                                                |
|        Column         |                          Description                           |
|                       |                                                                |
------------------------------------------------------------------------------------------
|                       |                                                                |
|    Before (19-20):    |                                                                |
|                       |                                                                |
|         01-12         | Skip to this line number before printing when the Carriage     |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |

|                       | Skip to this Channel Number before printing when the Carriage  |
|                       | Control Type Field (column 53) of the Header Specification is  |
|                       | blank.                                                         |
|                       |                                                                |
|         13-99         | Skip to this line number before printing when the Carriage     |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|         A0-A9         | Skip to this line (100-109) before printing when the Carriage  |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|         B0-B2         | Skip to this line (110-112) before printing when the Carriage  |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|         blank         | Do not skip lines.                                             |
|                       |                                                                |
|    After (21-22):     |                                                                |
|                       |                                                                |
|         01-12         | Skip to this line number after printing when the Carriage      |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|                       | Skip to this Channel Number after printing when the Carriage   |
|                       | Control Type Field (column 53) of the Header Specification is  |
|                       | blank.                                                         |
|                       |                                                                |
|         13-99         | Skip to this line number after printing when the Carriage      |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|         A0-A9         | Skip to this line (100-109) after printing when the Carriage   |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|         B0-B2         | Skip to this line (110-112) after printing when the Carriage   |
|                       | Control Type Field (column 53) of the Header Specification     |
|                       | contains L or 1.                                               |
|                       |                                                                |
|         blank         | Do not skip lines.                                             |
|                       |                                                                |
------------------------------------------------------------------------------------------

When skipping to printer channels, you should use a Line Counter
Specification to define those channels.  If you do not, the line number
positions for the channels are computed as follows:  line number =
channel number times 5 (Channel 1 is always line 6).  For instance, if
you enter 10 in this field, the printer paper is advanced to line 50 (10
x 5).

If you skip beyond the overflow line (but not to a new page), the
overflow indicator (if used) is turned ON and normal page overflow
processing is performed.  (See the Fetch Overflow/Release Field (column
16) for details about overflow processing.)  Do not skip beyond the
printer forms length defined in the Line Counter Specification.

When you use this field, the file is normally assumed to be a print file.
See the Space Field (columns 17-18) for more information on the
processing that occurs for print files.

Output Indicators (Columns 23-31).   

The output indicators field specifies the indicators that must be ON or
OFF for the record to be written.  You can condition an entire record or
a field in the record using this field.  To condition a record, enter the
indicators in the record description line (see the Record Description
Fields).  To condition a field, enter the indicators in the field
description line (see the Field Description Fields).

--------------------------------------------------------------------------------------------
|                       |                                                                  |
|        Column         |                           Description                            |
|                       |                                                                  |
--------------------------------------------------------------------------------------------
|                       |                                                                  |
|      23, 26, 29:      |                                                                  |
|                       |                                                                  |
|           N           | Write this record only if its corresponding indicator (in        |
|                       | columns 24-25, 27-28, or 30-31) is OFF.                          |
|                       |                                                                  |
|         blank         | Write this record only if its corresponding indicator (in        |
|                       | columns 24-24, 27-28, or 30-31) is ON.                           |
|                       |                                                                  |
| 24-25, 27-28, 30-31:  |                                                                  |
|                       |                                                                  |
|         01-99         | A general indicator set by a previous Calculation Specification  |
|                       | operation or that identifies a record type or field.             |
|                       |                                                                  |
|         F0-F9         | A function key indicator previously set as a general indicator   |
|                       | by the RPG VPLUS Interface or by a DSPLY or DSPLM operation.     |
|                       |                                                                  |
|         H0-H9         | A halt indicator.                                                |
|                       |                                                                  |
|     KA-KN,\KP-KY      | A command key indicator set previously as a general indicator or |
|                       | that was set previously by the RPG Screen Interface.             |
|                       |                                                                  |
|         L0-L9         | A control-level indicator (L0 is always ON).                     |
|                       |                                                                  |
|          LR           | The last-record indicator.                                       |
|                       |                                                                  |
|          MR           | The matching-record indicator.                                   |
|                       |                                                                  |
|       OA-OG, OV       | An overflow indicator assigned to this file.                     |
|                       |                                                                  |
|         U1-U8         | A user indicator (normally set before the program is executed).  |
|                       |                                                                  |
|          1P           | The first-page indicator.                                        |
|                       |                                                                  |
|         blank         | Do not use an output indicator.                                  |
|                       |                                                                  |
--------------------------------------------------------------------------------------------

You can use one or more AND and OR lines when you need to condition the
record with more than three indicators (see the AND/OR Field, columns
14-16).

You cannot use AND or OR lines to condition a field.  If you need to
condition a field with more than three indicators, consolidate them to
three by using the SETON Calculation Specification operation.  For
example, suppose you want to suppress the printing of a field when any
one of five possible error indicators (02, 04, 06, 08, and 10) are ON.
Use the SETON operation to turn indicator 12 ON when indicators 02, 04,
and 06 are ON. Then condition the field with indicators 12, 08, and 10.

N (Not) 

The not value specifies that, for the record or field to be written, the
indicator in the associated field (columns 24-25, 27-28, or 30-31) must
be OFF.

If this is a Header or Detail record (the file type is H or D), make sure
that at least one indicator does not have an N associated with it;
otherwise, the record is written at the beginning of the logic cycle
after records conditioned by the 1P indicator.  (This happens because all
indicators are OFF at the beginning of the logic cycle.)

01-99 (General Indicators) 

General indicators identify input record types in a file and show the
results of Calculation Specification operations.  They are the most
frequently-used indicators.

F0-F9 (Function Key Indicators) 

You can use function key indicators the same way you use general
indicators.

Function key indicators have special meanings when used with the RPG
VPLUS Interface.  They are used by VPLUS to signal "events" that take
place at the user terminal.  When the user presses Enter, F0 is turned
ON. When the user presses f1 to f8, the corresponding function key
indicator is turned ON. When an event 9 or greater takes place, function
key indicator F9 is turned ON. See Chapter 10 for a complete discussion
of the RPG VPLUS Interface.

Function key indicators F1-F8 also have special meanings when used in
conjunction with the SET, DSPLY, and DSPLM Calculation Specification
operations (see these operations in Chapter 8 for details).

H0-H9 (Halt Indicators) 

Halt indicators are normally used to print error messages and to halt the
program at the end of the current cycle (before standard RPG error
processing begins).  You can also use them to write records before the
standard error processing begins.

KA-KN, KP-KY (Command Key Indicators) 

You can use command key indicators the same way you use general
indicators.

When you use an RPG Screen Interface (RSI) file, the command keys may
have a special meaning.  A user at a terminal keyboard presses f1 
followed by a key from the top row of the keyboard to turn on one of the
twenty-four command key indicators.  The RPG Screen Interface then
performs the appropriate action.  You enable the command key indicators
when you build the screen forms file.  You can use command keys that have
not been enabled the same way you use general indicators.  See Chapter 11
for information on the RPG Screen Interface and the RPG Utilities 
Reference Manual (SIGEDITOR) for information on creating an RSI forms
file.

L1-L9, L0 (Control-Level Indicators) 

Control-level indicators are turned ON when they are assigned to input
fields and control breaks occur in those fields.  Use them with fields
and records that you want to write when control breaks occur.  The L0
indicator is always ON. Use it for records or fields that you want to
write at total time regardless of whether a control break occurs.

If you enter both a control-level and an overflow indicator, the record
is written when the overflow line is reached.  If this is a total record
(the Type Field, column 15, contains a T) and it is not conditioned by a
overflow indicator, the record is written after the last record in the
control group is processed.  If this is a detail record (the Type Field
contains a D) and it is not conditioned by an overflow indicator, the
record is written only after the first record of the new control group is
processed.

LR (Last-Record Indicator) 

This indicator is turned ON when there are no more input records to
process.  During the next logic cycle, all output records conditioned by
LR are written provided the other indicators that condition the output
are also satisfied.

OA-OG, OV (Overflow Indicators) 

Overflow indicators are turned ON when the overflow line (as specified by
the Line Counter Specification) is encountered.  When it is ON, records
conditioned by it are written (provided the records satisfy the other
indicators entered in this field).

Use only one overflow indicator per file.  You should also enter this
indicator in the Overflow Indicator Field (columns 33-34) of the File
Description Specification.  If you do not use an overflow indicator, the
paper is advanced automatically to a new page when the end-of-page is
reached.  If some records or fields in a file do not use the assigned
overflow indicator but specify skipping to a new page (see the Skip Field
(columns 21-22), the overflow indicator is turned OFF before the paper
advances.

When you use an overflow indicator, you normally enter a Line Counter
Specification to define the overflow line and other printer line
positions.

You can enter an overflow indicator in an AND or OR line.  However, be
sure that there is only one overflow indicator that satisfies the AND or
OR relationship.  The indicator must be defined in the Overflow Indicator
field of the File Description Specification.

Be careful when using an overflow indicator and a record-identifying
indicator in an AND relationship.  If overflow occurs but the current
record type is not the one specified by the record-identifying indicator,
no output is produced.  Therefore, if possible, use overflow and
record-identifying indicators in OR relationships when conditioning
record output.

Do not use an overflow indicator to condition output of exception records
(those that have an E in the Type Field, column 15); however, you can use
this indicator to condition exception record fields.

U1-U8 (User Indicators) 

These indicators, when turned ON and OFF automatically by the Job Control
Word (JCW), let you condition the output of an entire file.  Otherwise,
you can use them like general indicators to condition the output of
records and fields (you must turn them ON yourself via the SETON
Calculation Specification operation).

1P (First-Page Indicator) 

The first-page indicator is normally used to print headings on the first
page of a report.  The headings are printed during pre-cycle processing.
You can also use this indicator, together with an overflow indicator, to
print the headings on each page of the report.  (Use the 1P indicator for
this purpose only when no other indicators are available.)

Use the 1P indicator only with heading and detail records (see the Type
Field, column 15).  Do not use it with total or exception records.  Do
not use 1P with other indicators (except the user indicators, U1-U8) when
conditioning output (if you precede it with N, you can enter other
indicators preceded by N).

Since 1P lines are written during pre-cycle processing, be careful that
they do not contain data derived from input or that are calculated by the
program.  You can use 1P to condition lines containing the predefined
fields:  PAGE, PAGE1 - PAGE7, UDATE, UDAY, UMONTH, UYEAR. You can also
use 1P with compile-time and preexecution time array elements and User
Data Structure fields.

Example 

Figure 9-5  shows an output record that is conditioned by two general
indicators.  When indicator 20 (only) is turned ON, the fields JOB, EXP,
and PAY are written.  When indicators 20 and 30 are turned ON, fields
NAME, JOB, EXP, and PAY are written.  When indicator 20 is turned OFF, no
fields are written.
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|              _______________________________________________________            |
|                                                                                 |
|            OPRINTX  D 1      20                                                 |
|            O                 30      NAME      10                               |
|            O                         JOB       20                               |
|            O                         EXP       30                               |
|            O                         PAY       40                               |
|                                                                                 |
|                                                                                 |
___________________________________________________________________________________

          Figure 9-5.  Using Output Indicators 



MPE/iX 5.0 Documentation