In positions 32 through 37, use one of the following entries to specify each field that is to be written out:
The field names used must be defined in the program. Do not enter a field name if a constant or edit word is used in positions 45 through 70. If a field name is entered in positions 32 through 37, positions 7 through 22 must be blank.
Fields can be specified in any order because the sequence in which they appear on the output records is determined by the entry in positions 40 through 43. If fields overlap, the last field specified is the only field completely written.
When a non-indexed array name is specified, the entire array is written. An array name with a constant index or variable index causes one element to be written. When a table name is specified, the element last found in a LOKUP (Look Up) operation is written. The first element of a table is written if no successful LOKUP operation was done.
The conditions for a field and the conditions for the record it is contained in must be satisfied before the field is written out.
To use automatic page numbering, code PAGE in positions 32 through 35 as the name of the output field. Indicators specified in positions 23 though 31 do not condition the field, but rather control the resetting of the PAGE field. When indicators are specified and their conditions are met, the PAGE field is set to zero and incremented by 1 before output; when the conditions are not met, the PAGE field is incremented by 1 and then output. If page numbers are needed for several output files (or for different numbering within one file), the entries PAGE1 through PAGE7 can be used. The PAGE fields are automatically zero-suppressed by the Z edit code.
For more information on the PAGE reserved words, see RPG/400 Words with Special Functions.
*PLACE is an RPG/400 reserved word that is used to repeat data in an output record. Fields or constants that have been specified on previous specification lines can be repeated in the output record without having the field and end positions named on a new specification line. When *PLACE is coded in positions 32 through 37, all data between the first position and the highest end position previously specified for a field in that output record is repeated until the end position specified in the output record on the *PLACE specification line is reached. The end position specified on the *PLACE specification line must be at least twice the highest end position of the group of fields to be duplicated. *PLACE can be used with any type of output. Blank after (position 39), editing (positions 38, 45 through 70), data format (position 44), and relative end positions cannot be used with *PLACE.
The user date reserved words (UDATE, *DATE, UDAY, *DAY, UMONTH *MONTH, UYEAR, *YEAR) allow the programmer to supply a date for the program at run time. For more information on the user date reserved words, see Rules for User Date.
The reserved words *IN, *INxx and *IN,xx allow the programmer to refer to and manipulate RPG/400 indicators as data.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.