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

1- 18
A discussion of the commands for SORT3 as compared to XSORT appears in appendix A.
Your MPE Commands Provide:
Name of the program--XSORT.PUB.SYS
Nameof the files you want to sort. The formal designatorfor a single-filesort is XSORTIN. For multiple-
file sorts, formal file designators are XSORTIN1 through XSORTIN9.
If XSORT can open the file XSORTIN, it assumes you want to do a single-filesort. If XSORTIN cannot
be opened, XSORT assumes you want to do a multiple-filesort, starting with XSORTIN1. (See "Use of
the MPE RESET Command" below for a description of how to avoid problems that may occur when run-
ning a multiple-file sort after a single-file sort.)
Name of your output file. The formal designator is XSORTOUT.
Name of the file containing specifications of the sort. The formal designator is XSORTEXT, which de-
faults to $STDIN.
Use of the MPE RESET Command:
To ensure that succeeding executions of XSORT use the correct files, it is recommended that you use MPE
RESET commands after each use of XSORT to reset all the MPE FILE equations issued for your input,
output, and text files.
For example, in a job stream:
.....
!FILE XSORTIN=TESTFILE
!FILE XSORTOUT=TESTFILE
!FILE XSORTEXT=TESTSPEC
!RUN XSORT.PUB.SYS
!RESET XSORTIN
!RESET XSORTOUT
!RESET XSORTEXT
....
Without the RESETs, the next sort could accidentally use the file TESTFILE for input (if the new sort is a
multiple-file sort, naming XSORTIN1 instead of XSORTIN) or TESTSPEC for the sort specifications (if an
overriding file equation for XSORTEXT is not issued).
Input Files
XSORT can input sequential MPE files, including files on non-disk devices such as tape. (Please see
Section 7 for the commands required.)
KSAM files may be input. Caution should be taken, however, because XSORT will skip deleted records. A
deleted record has its first two bytes set to -1 (to hex "FFFF"). For Address-out sorts (SORTA), XSORT
reads KSAM files in chronological sequence and determines record numbers accordingly.
XSORT will normally assure that the first record for a KSAM file is record number 0. If you wish to start
the Address-out numbering at 1, then you must supply the S Option spec with a "1" in column 7 or build
the KSAM file with the Firstrec=1 option. (See Section 4 for further information regarding S Option
specification.)
NOTE XSORT will not process IMAGE data base files.
The formal designator for a single-file sort is XSORTIN. For multiple-file sorts, formal file designators are
XSORTIN1 through XSORTIN9. The multiple-file designators do not have to be continuous. You can skip
file numbers, selecting XSORTIN1, XSORTIN7, and XSORTIN3, for example. However, you must start