The SRTPRC (sort processor) program will sort a list maker data files. Once a data file is created through the use of any list maker, the SRTPRC program may be used to sort the gathered data into a preferred order.
STRPRC will also sort delimited data files created from a source outside of state software. The field names in the delimited file will be converted to token names using the following rules:
- special characters and spaces are converted to underscores
- field names are converted to uppercase
- field names beginning with a numeric character will be prefixed with an "X"
- if necessary, field names are enclosed in angle brackets
Whether you are sorting a list maker data file or a delimited data file, SRTPRC will not create a .TXT file nor generate a report. The program simply sorts the data files. The sorted files generated by SRTPRC can then later be used with the LSTPRC to create a .TXT file.
Using the program
The program may be executed from the main menu by typing:
Another way to execute the SRTPRC program is to type it directly from the $ prompt. To do this, it is necessary to specify the data file to be sorted and the sort field token names in the sort sequence wanted.
The sort field token names must match the tokens defined within the data file to be sorted and must be enclosed within quotes. The beginning token delimiter "<" and ending token delimiter ">" are optional. The tokens must also be separated by commas. Up to ten token names can be specified. For example:
The sorted data file from the above command will have the same name as that specified on the command line, but will have a next higher version number.
The above command can only be used when the token names are known. If the token names are not known or if you prefer the "RUN" command or the menu system, a screen formatted program will be executed.
On the above screen you must enter the name of the data file to be sorted as the input file. You also have the option of entering an output file name, however, if no output file name is entered, the sorted data file will have the same name as the input file only a next higher version number.
When the information has been added to the above screen, press the
[Accept] key. At this point, a second screen will be displayed listing the tokens which may be sorted.
SRTSCN - Sort File Selection Screen
When using SRTPRC from the "RUN" command or the Menu system, two screens will be displayed. The second of them is the sort screen. This screen lists the tokens from the input data file. To the left of the tokens is a two character blank field used to indicate the sort sequence order. You can tab to the desired field and enter a numeric value from 1 through 10. (1 in the blank field for the sort code to be sorted first, and so on through 10.)
The above selection screen will contain up to 16 tokens on one screen. If there are less than 16 tokens, a "[No more tokens]" message will be near the bottom of the screen. If there are more than 16 tokens, a "[More tokens]" message will be displayed. By pressing the
[Prev tokens] key and the
[Next tokens] key you can scroll through all the token selections. A sort selection can be made on any of the tokens on any screen.
When all sort selections are made, press the
[Reorder Tokens] key. This will place the selected tokens in the sort order sequence beginning at the top of the screen. At this point, you may choose to change the numerical order of the selected tokens or decide not to sort by a certain token. In either case, simply tab to the two character field at the left of the token and change the number or remove it.
When finished making selections, press the
[Accept] key to sort the data file. The sorted output data file name will be displayed.