Use position 45 to describe the sequence (either ascending or descending) of the data in an array or table loaded at prerun time or compile time.
When an entry is made in position 45, the array or table is checked for the specified sequence at the time the array or table is loaded with data. If a prerun-time array or table is out of sequence, control passes to the RPG/400 exception/error handling routine.
Ascending sequence means that the array or table entries start with the lowest data entry (according to the collating sequence) and go to the highest. Descending sequence means that the array or table entries start with the highest data entry and go to the lowest. Items with equal values are allowed.
If two arrays or tables are entered in alternating format, the entry in position 45 applies to the array or table containing the entry that appears first on the record.
When the LOKUP operation is used to search an array or table for an entry to determine whether the entry is high or low compared with the search argument, a sequence must have been specified (A or D) for the array or table. See LOKUP (Look Up) for more information.
A run-time array (loaded by input and/or calculation specifications) is not sequence checked. However, an A or D entry must be specified if a high or low LOKUP operation is processed. Sequence must be specified if the SORTA operation code is used with the array.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.