Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 31 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how you can sort by a date, and calculate a specific day after and before a date, and the last day of the quarter for a date. The input date is in the form C'mmddyy' and the output dates will be in the form 'ddd-yyyy'. The SORTIN data set has these input records with a C'mmddyy' date
field in positions 1-6:
The SORT statement sorts by the C'mmddyy' date. We use 1,6,Y2W for the sort field to match the C'mmddyy' date. The OUTFIL statement writes a heading and performs four operations on each date. It converts the input date to C'ddd-yyyy' form, gets the next Friday date in C'ddd-yyyy' form, gets the previous Sunday date in C'ddd-yyyy' form, and gets the end of the quarter date in C'ddd-yyyy' form. We use 1,6,Y2W for the input field to match the C'mmddyy' date, and we use TOJUL=Y4W(-) to give us a C'ddd-yyyy' output date. SORTOUT will have these records:
Note that the '000000' and '999999' input values are treated as special indicators for output. |
Copyright IBM Corporation 1990, 2014
|