Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 18 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how to list records with dates outside of the valid range (for example, a month not between 01-12). Note: Dates with an invalid digit (A-F) can
result in a data exception (0C7 ABEND).
The input records might be as follows:
The SORT statement sorts the records by the name
in positions 1-12. After the SORT statement is processed, the sorted
records will look like this:
The OUTREC statement uses TOGREG to convert each
ccyymmdd value in positions 16-23 to a ccyymmdd value in positions
30-37; the third column will be identical to the second column for
valid dates and special indicators, but will contain asterisks for
invalid dates. After the OUTREC statement is processed, the reformatted
records will look like this:
The OUTFIL statement selects the records that have
an asterisk in position 30, that is, the records with an invalid date.
The Boenig record is invalid because mm is 13, and the Kolusu record
is invalid because mm is 09 but dd is 31 (September only has 30 days).
Note that the special indicator of all 0s for the Casad record is
valid. The output records would be as follows:
|
Copyright IBM Corporation 1990, 2014
|