SORT SORT Use the SORT command to read fixed-length records from a input file,
arrange them in ascending EBCDIC order according to specified sort
fields, and create a new file containing the sorted records. The format
of the SORT command is:
r------ SORT fileid1
fileid2
fileidl fileid2
is the file identifier (filename, filetype, filemode) of the
file containing the records to be sorted.
is the file identifier (filename, filetype, filemode) of the
new output file to contain the sorted records.
The and output files must not have the same file identifiers,
since SORT cannot write the sorted output back into the space occupied by the input file. If a file with the same name as the output file
already exists, an error message is issued and the SORT operation does
not take place. Sort Control Fields: After the SORT command is entered, eMS responds wIth message on the terminal: DMSSRT604R SORT FIELDS: You should respond by entering one or more pairs of numbers of the form
"xx yy" separated by one or more blanks. Each "xx" is the starting
character position of a sort field within each input record and "yy" is
the ending character position. The leftmost pair of numbers denotes the
major sort field. The number of sort fields is limited to the number of
fields you can enter on one line. The records can be sorted on up to a
total of 253 positions. fo± The sorting operation takes
place with two passes of the input file. The first pass creates an
ordered pointer table in virtual storage. The second pass uses the
pointer table to read the input file in a random manner and write the
output file. Therefore, the size of storage and the size and number of
sort fields are the limiting factors in determining the number of
records that can be sorted at anyone time. An estimate of the maximum
number of records that can be sorted is: NUCSIZE r , 1 VMSIZE - 256K I 1---------------1 + 172K , 256K I L VMSIZE - NUCSIZE NR ----------------
14 + NC Section 2. Commands 171
NR is the estimated maximum number of input records.
NC is the total number of characters in the defined sort fields. VMSIZE is the storage size of the virtual machine.
112K is the size of the resident CMS nucleus and reserved pages
(provided shared segments are available) For example, enter the command and respond to the prompting message:
sort name address a1 sortedna address b1 DMSSRT60UR ENTER SORT FIELDS: 1 10 25 28
The records in the NAME ADDRESS file are sorted on positions 1-10 and
25-28. The sorted output is written into the newly created file SORTEDNA ADDRESS. If you have a 320K virtual machine, you can sort a
maximum of 5412 records. VMSIZE-172K 320K-172K 148K 151,552
NR ---------= = -------= 5412
14 + NC 14 + 14 28 28 DMSSRT604R ENTER SORT FIELDS: You are requested
them in the form
Fields."
to enter SORT control fields. You should enter
described previously in "Entering Sort Control DMSSRT002E FILE 'fm ft fm' NOT FOUND RC=28 DMSSRT009E COLUMN 'col' EXCEEDS RECORD LENGTH RC=24 DMSSRT019E IDENTICAL FILEIDS RC=24 DMSSRT034E FILE 'fn ft fm' IS NOT FIXED LENGTH RC=32 DMSSRT037E DISK 'mode' IS READ/ONLY RC=36 DMSSRT053E INVALID SORT FIELD PAIR DEFINED RC=24 DMSSRT054E INCOMPLETE FILEID SPECIFIED RC=24 DMSSRT062E INVALID * IN FILEID RC=20 DMSSRT063E NO LIST ENTERED RC=40 DMSSRT070E INVALID PARAMETER 'parameter' RC=24 DMSSRT104S ERROR Inn' READING FILE 'fn ft fm' FROM DISK RC=100 ERROR Inn' WRITING FILE 'fn ft fm' ON DISK RC=100 DMSSRT212E NUMBER OF RECORDS EXCEEDED RC=40 172 IBM VM/310 CMS Command and Macro Reference
Previous Page Next Page