HP RPG/XL Programmer's Guide (30318-90001)

9- 5
Reference Manual
). Figure 9-1 and Figure 9-2 show how to use XSORT
and how to process the address-out file in an RPG program. Figure
9-1 lists the job file that performs the sort and runs the RPG
program. The input file, SEQ1, is sorted by zip code, last name and
first name. Only records whose zip codes equal 95501 and whose Type
Codes equal AA are sorted. The XSORT parameters are placed after the
!RUN XSORT.PUB.SYS command in the job file and the output
(address-out) file is SEQ2.
Figure 9-1. Creating an address-out File With XSORT
When XSORT finishes, the job file executes program, PROG1. PROG1 reads
the ADDROUT file, SEQ2, created by XSORT and uses its record addresses to
access the data records in SEQ1. Figure 9-2 lists the File Description
and File Extension Specifications that process these files.
Figure 9-2. Using an address-out File - Program PROG1