I have a JCL that splits an input file into multiple output files and counts how many times this is done by adding a 1 to the OUTREC in various buckets:
SORT FIELDS=(37,8,CH,A,9,6,CH,A)
OUTFIL FILES=(1),
* FILE(1) HAS NEW TRANSMISSIONS (0 DAYS OLD)
INCLUDE=(9,6,CH,LE,C'YYMMDD(0)',AND,
9,6,CH,GT,C'YYMMDD(-1)'),
OUTREC=(37,8,C'00001',C'00000',C'00000',C'00000',C'00000',
C'00000',C'00000',C'00000',C'00000',C'00001')
OUTFIL FILES=(1),
* FILE(1) HAS NEW TRANSMISSIONS (0 DAYS OLD)
INCLUDE=(9,6,CH,LE,C'YYMMDD(0)',AND,
9,6,CH,GT,C'YYMMDD(-1)'),
OUTREC=(37,8,C'00001',C'00000',C'00000',C'00000',C'00000',
C'00000',C'00000',C'00000',C'00000',C'00001')
The above is repeated for various age buckets.
I am trying to add the age of the record in the OUTREC, but cannot figure out how to do that based on DATEDIFF or any other methods. The date of the record starts at character 9 for 6 chars and the INCLUDE processes them correctly so I know it should be possible... Any help is greatly appreciated!