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

3-: 20
Comments
1 This line defines the sales transaction file, TRANSFL. This file
is an MPE file.
2 This line defines the KSAM customer master file, MASTFL.
Columns 7-14 contain the name of the customer master file,
MASTFL.
Column 15 is U to indicate that MASTFL will be updated.
Column 16 is C to indicate that MASTFL will be processed in a
chained fashion.
Column 28 is R to specify that MASTFL will be processed
randomly.
3 MSGFL is a message file that is used to report program and other
errors. MSGFL is directed to the line printer.
4 This line defines the record type for all records in TRANSFL and
is followed by the field definitions for that record.
5 This line defines the record type for active records in MASTFL
and is followed by the field definitions for that record.
6 This line defines the record type for inactive records in
MASTFL.
Column 27 specifies that inactive records have an I in position
5. Inactive records may exist, but they cannot be updated.
(Inactive records reflect customers whose information either has
been deleted or is obsolete. They remain in the file to
facilitate error handling.)
7 This line reads MASTFL randomly by primary key.
Columns 18-21 define IDNO as the key to be used for reading
MASTFL.
Columns 28-32 are CHAIN to specify a chained read operation for
MASTFL.
Columns 54-55 turn on indicator 60 when a record matching IDNO
is not found in MASTFL.
8 This line adds the contents of field CHARGE to the filed CURBAL
(customer balance field in MASTFL) when an active record for
IDNO is found.
9 This line defines the output record for MASTFL.
Columns 24-25 specify that indicator 01 must have been turned on
(a transaction record must have been read) before records in
MASTFL are updated.
Columns 27-28 specify that indicator 02 must be turned on (an
active record is found in MASTFL) before records in MASTFL are
updated.
10 This line defines the customer balance field, CURBAL. This field
is the only field that is updated in MASTFL.
11 This line defines the first output record format for the message
file, MSGFL.
Columns 27-28 contain 03 to print an error message when a