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

8- 79
The specifications for the sort are supplied by the file designated TSTSPECB.
HSORTR 13A OX 80 EXAMPLE USING MIXED SECTIONS & SETS.
S Y 75 OVERLAY EXISTING OUTPUT; 75 RECS MAX
I*
I C 6EQCX SECTION-A, TYPE 1
IAC 23 24LEC50 (INCLUDE X'S BELOW 50)
IOC 6EQCY SECTION-A, TYPE 2
IAC 23 24LEC50 (INCLUDE Y'S BELOW 50)
IOC 6EQCM SECTION-A, TYPE 4
IAC 23 24LEC50 (INCLUDE M'S BELOW 50,
IAC 55 58GTF 51 54 AND ABOVE LIMIT)
F* SECTION-A FIELD DESCRIPTIONS:
FNC 2 5 SORT BY ITEM#, AND
FNC 1 CLASS
FDV OUTPUT BLANK IN POSITION 1
FDC 1 71 OUTPUT DATA (FROM INPUT 1-71)
O*
O C 6EQCZ SECTION-B, TYPE 3
OAC 12 13NECCA (OMIT Z'S NOT IN CALIFORNIA)
I SECTION-B, INCLUDE ALL OTHER RECORDS
F* SECTION-B FIELD DESCRIPTIONS:
FNC 2 5 SORT BY ITEM#,
FNC 1 CLASS, AND
FNC 73 80 LINE#
FDV * OUTPUT ASTERISK IN POSITION 1
FDC 1 71 OUTPUT DATA (FROM INPUT 1-71)
FDC 73 80 OUTPUT ORIGINAL LINE#'S
Because this is a multiple file sort, the S Option is used. The Y entered in column 8 indicates that you are
willing to have the output file overlay an already existing file.
There are two sections, A and B, set off by the specifications. Section A is comprised of three Include Sets,
plus control fields and data fields. A blank forced in position 1 of the output will "flag" Section A.
Section B is comprised of an Omit Set, an Include-all Set, and the control and data fields. An asterisk
forced into position 1 of the output record "flags" Section B.
This is the input file, designated TSTINB, for the sort.
Item #Size Code
| |
Class|Group State | Description Limit Cost Line #
| | | | | | | |
/\/-\/\ /\ /\ /---------------\ /-------\ /------\
A0001X CA 01 SECTION-A, TYPE-1 05001021 00001000
A0113Z TX 21 SECTION-B, TYPE-3 09000899 00002000
A9059Z CA 57 SECTION-B, OTHER 05002001 00003000