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

8- 92
Sample Sort 3
This sample sort utilizes the multiple input file feature of XSORT. It combines the Weekly Bookings file
and the Weekly Sales file. The sequence of the combined output file will be by customer number.
Additionally, the Weekly Sales file is reformatted on output to the sorted file in order to match the format
of the Weekly Bookings file records.
The file statements required for this sort are:
FILE XSORTIN1=WKBOOK
FILE XSORTIN2=WKSALE
FILE XSORTIN3=HISTUPD
Here are the specifications as they would appear at the terminal and on the specification form.
HSORTR 10A X 90
S 36
I C 1 2EQCWB SEL.WKLY.BK.REC.
FNC 3 12 CUSTNO CUSTOMER NUMBER
FDC 1 50
I C 1 2EQCWS SELECT WEEKLY
I* SALES RECORD
FNC 15 24 CUSTNO CUSTOMER NUMBER
FDC 1 2 RECCDE RECORD CODE
FDC 15 24 CUSTNO CUSTOMER NUMBER
FDC 25 25 CUSTTY CUSTOMER TYPE
FDC 3 8 INVNUM INVOICE NUMBER
FDC 50 50 TRANCD SALES TYPE
FDC 26 27 MRCHLN MERCHANDISE LINE
FDC 28 37 PRODCD PRODUCT CODE
FDC 43 44 STACDE STATE CODE
FDC 45 47 SLSTER SALES TERRITORY
FDC 48 49 SLSMN1 SALESMAN NUMBER
FDC 50 50 TRANCD SALES TYPE
FDC 11 12 INVMON INVOICEDATEMONTH
FDC 13 14 INVYR INVOICEDATEYEAR
FDC 38 42 UNITSF SALES UNITS