Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 7 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how you can left-justify characters in an input field so they can be sorted without regard to the leading blanks. The 15-byte input records might look like this:
Note that if we sort these records using just this control statement:
The 15-byte output records are as follows:
Because of the different number of leading blanks in the input
records, we don't get what we want. To fix that, while keeping the
leading blanks in the original records, we use the JFY function of
INREC to make a left-justified copy of the 15-byte input field at
positions 16-30, SORT on it and use OUTREC to remove the left-justified
field. With the INREC, SORT and OUTREC control statements shown previously, the output records are:
If we wanted the output to contain the sorted left-justified fields,
we could use these control statements:
The output records would then be:
|
Copyright IBM Corporation 1990, 2014
|