Example 8
OPTION COPY,Y2PAST
OUTFIL FNAMES=Y4,
OUTREC=(1,19,
21,2,PD0,M11,C'/', transform mm
22,2,PD0,M11,C'/', transform dd
20,2,Y2P, transform yy to yyyy
24,57)
This example illustrates how to transform an existing data set with a packed decimal date field of the form P'yymmdd' (X'0yymmddC') in bytes 20-23 into a new data set with a character date field of the form C'mm/dd/yyyy' in bytes 20-29. yy represents the two-digit year, yyyy represents the four-digit year, mm represents the month, dd represents the day, and C represents a positive sign.
The input data set has an LRECL of 80 and the Y4 data set will have an LRECL of 86.
The Y2PAST=26 option sets the century window to be used to transform
two-digit years into four-digit years. If the current year is 2006,
the century window will be 1980 to 2079. Using this century window,
the input and output fields might be as follows:
Input Field (HEX) Output Field (CH)
20 20
| |
0020505F 05/05/2002
0950823C 08/23/1995
0980316C 03/16/1998
0000316F 03/16/2000