RPG/400 Help

Positions 15-16 (Sequence)

Entry
Explanation
Any two alphabetic characters
The program does not check for special sequence.
Any two-digit number
The program checks for special sequence within the group.

The numeric sequence entry combined with the number (position 17) and option (position 18) entries causes the program to check the sequence of input records within a file. If the sequence is not correct, control passes to the RPG/400 exception/error handling routine. If AND or OR lines are specified, the sequence entry is made on the main record line of the group, not on the AND or OR lines.

Alphabetic and numeric entries can be made for different records (different record identification lines) in the same file, but records with alphabetic entries must be specified before records with numeric entries.

Alphabetic Entries

Enter any two alphabetic characters in these positions when no sequence checking is to be done. It is common programming practice to specify these codes in a sequence that aids in program documentation. However, it is not necessary to use unique alphabetic entries.

Numeric Entries

Enter a unique numeric code in positions 15 and 16 if one record type must be read before another record type in a file. Numeric entries must be in ascending order, starting with 01, but need not be consecutive. When a numeric entry is used, the appropriate entries must be made in positions 17 and 18.

To specify sequence checking, each record type must have a record identification code, and the record types must be numbered in the order in which they should appear. This order is checked as the records are read. If a record type is out of sequence, control passes to the RPG/400 exception/error handling routine.

Sequence numbers ensure only that all records of each record type precede the records of senior sequence numbered record types. The sequence numbers do not ensure that records within a record type are in any certain order. Sequence numbers are unrelated to control levels and do not provide for checking data in fields of a record for a special sequence. Use positions 61 and 62 (matching fields) to indicate that data in fields of a record should be checked for a special sequence.


[ Top of Page | Previous Page | Next Page | Table of Contents ]