Before using Sort, you must determine the type of sort you require, the length and format of the sorting fields in the data, the length of your data records, and the amount of auxiliary and main storage you will allow for sorting.
To determine the PLISRTx entry point that you will use, you must decide the source of your unsorted data, and the destination of your sorted data. You must choose between data sets and PL/I subroutines. Using data sets is simpler to understand and gives faster performance. Using PL/I subroutines gives you more flexibility and more function, enabling you to manipulate or print the data before it is sorted, and to make immediate use of it in its sorted form. If you decide to use an input or output handling subroutine, you will need to read Data input and output handling routines.
The entry points and the source and destination of data are as follows:
| Entry point | Source | Destination |
|---|---|---|
| PLISRTA | Data set | Data set |
| PLISRTB | Subroutine | Data set |
| PLISRTC | Data set | Subroutine |
| PLISRTD | Subroutine | Subroutine |
Having determined the entry point you are using, you must now determine the following things about your data set:
Specify these options on the SORT statement, which is the first argument to PLISRTx. After you have determined these, you must determine two things about the records to be sorted:
Specify these on the RECORD statement, which is the second argument to PLISRTx.
Finally, you must decide on the amount of main and auxiliary storage you will allow for the Sort program. For further details, see Determining storage needed for Sort.