HP RPG/iX Utilities Reference Manual (30318-90006)

8- 77
8 Chapter 8 XSORT Applications
Introduction
There are three applications in this section. The first is a simple use of mixed include and omit sets in a
single section. The second application involves multiple sections and sets. In both, the "comments" are
used to make the sorts somewhat self-explanatory, and additional notes are provided to clarify what takes
place.
Application #1
The file containing the specifications for the sort is designated TSTSPECA.
HSORTR 5D OX 72
I C 3EQC1 }
include set
\ INCLUDE IF 1 IN POSITION 3
IAC 5EQC1 } |
one section
AND 5
O C 3EQC1 }
omit set
| OMIT OTHERS WITH 1 IN POSITION
I C 7NEC1 }
include set
/ INCLUDE IF NOT 1 IN POSITION 7
FNC 9 13
FNC 9 13
FDC 1 72
The comment section for the file explains what will be included and omitted by the sort. Note that the two
include sets and one omit set form a single Record Section. Also, the sorted file will be in descending order.
The input file, designated TSTINA, has comments which tell you whether each record will be included or
omitted, according to the specifications in TSTSPECA.
Positions 3 5 7 9-13 18-72
1 1 1 A0001 =INCLUDE (1 IN POS.3 AND POS.5)
1 1 0 H9999 =INCLUDE (1 IN POS.3 AND POS.5)
1 0 1 N1045 =OMIT (1 IN POS.3)
1 0 0 B0002 =OMIT (1 IN POS.3)
0 1 1 A7523 =NOT INCLUDED (1 IN POS.7)
0 1 0 R3316 =INCLUDE (NOT 1 IN POS.7)
0 0 1 T9458 =NOT INCLUDED (1 IN POS.7)
0 0 0 B3257 =INCLUDE (NOT 1 IN POS.7)
Positions 3, 5, and 7 of the records contain different arrangements of 1's and 0's, and positions 9-13 are
filled with information which will determine the location of the sorted records with regard to the
descending order.
Here is the output file for the sort with the records marked to be omitted missing.
0 1 0 R3316 =INCLUDE (NOT 1 IN POS.7)
1 1 0 H9999 =INCLUDE (1 IN POS.3 AND POS.5)