Just one more thing. Here's he same code, but written in a different way.
//INTERLVE EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
//SYMNOUT DD SYSOUT=*
//SORTIN01 DD *
//SORTIN02 DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
If you look at the sort cards, you'll see that they now have "named" fields. These are DFSORT Symbols, defined under the SYMNAMES DD statement.
The position, length and type of the named symbols are converted by DFSORT to the traditional method of specification, which is listed along with the rest of the output, like this:
The * in the defintions means use the next available byte position (so for the first definition, that will be 1). The = means use the start position of the previously defined field. Fields can also be defined at an explicit starting position, This-Field,20,4,CH
The translation of your symbols from the above appears as output on the SYMNOUT dd statement:
------- ORIGINAL STATEMENTS FROM SYMNAMES -------
------------------ SYMBOL TABLE -----------------
If you are new to sorting, you might want to consider using the symbols. They are well-documented, with examples, in the manuals. There is a program written in rexx which is available from IBM's DFSORT team which will generate symbols from a Cobol copybook, so that you can use the same names as in a Cobol program.
Symbols help to document; make it more difficult to get the wrong definition of a field; make the code more maintainable (there might be several references to one field, which in the traditional way would have to be changed, correctly, in each place - with symbols, you just change the definition); allow for easy extension of records without having to constantly count how many bytes are in the original record; etc, etc.