CENTWIN defines a sliding or fixed 100-year window that determines the century to which 2-digit year data belongs when processed by SORT, MERGE, INREC, OUTREC or OUTFIL OUTREC control statements.
The 2-digit year data formats (Y2B, Y2C, Y2D, Y2P, Y2S and Y2Z) plus the full-date formats (Y2T, Y2U, Y2V, Y2W, Y2X, and Y2Y) work with CENTWIN to treat a 2-digit year value as a 4-digit year. The 2-digit and full-date year data formats can be specified on control statements as follows:
-
Use SORT/MERGE control statements to correctly collate 2-digit years that span century boundaries. For information on using the 2-digit and full-date data formats for SORT/MERGE field specifications, see CENTWIN Parameter (Optional).
-
Use INCLUDE/OMIT or OUTFIL INCLUDE/OMIT control statements for correct comparisons involving 2-digit year and full-date data formats. For information on using the 2-digit year data formats for INCLUDE/OMIT processing, see Specifying Field-to-Field Standard Comparisons for Year Fields. For more information on specifying full-date formats, see topics.
-
Use INREC/OUTREC or OUTFIL OUTREC control statements to convert 2-digit year and full-date data to 4-digit printable output. For information on using the 2-digit year data formats for OUTREC processing, see Converting Year Data with Century Window Processing on INREC, OUTREC, or OUTFIL OUTREC and Example 5. For more information on converting full-date formats, see the descriptions of the parameters fi and fy2f,(c), Full-Date Formats, and Full-Date Field Conversions.
In addition, two date formats, Y2ID and Y2IP, are provided for year conversion with INREC/OUTREC and OUTFIL OUTREC. These formats work with CENTWIN to expand a 2-digit year in packed decimal format to a 4-digit year while maintaining the packed decimal format in the output field.
CENTWIN ensures that year data spanning centuries will be sequenced correctly. For example, without CENTWIN processing, an ascending sort/merge would sequence the year 01 before the year 98. With CENTWIN processing, the 01 field could be recognized as a twenty-first century date (2001) and would thus be sequenced after 98 (1998) for an ascending sort.
The CENTWIN option generates either a sliding or fixed century window, depending on which form of CENTWIN is used: CENTWIN=s or CENTWIN=f.
-
CENTWIN=s specifies a sliding century window, which automatically advances as the current year changes.
The variable s is a number 0 through 100. This value is subtracted from the current year to set a century-window starting point. For example, in 1996 CENTWIN=20 would create the century window 1976 through 2075. Ten years later in 2006, the century starting year would slide to 1986 (2006 minus 20 = 1986) and the century window would be 1986 through 2085.
The CENTWIN delivered default is s=0, which means the current year is the starting year of a century window.
-
CENTWIN=f specifies a fixed century window.
The variable f is a 4-digit year (yyyy) between 1000 and 3000. For example, CENTWIN=1976 establishes a fixed starting year 1976 for the century window 1976 through 2075. This window will not change as the current year changes.
The century window defined by CENTWIN controls processing of year-data. If a 2-digit year field (indicated by Y2B, Y2C, Y2D, Y2P, Y2S, Y2Z, Y2ID, Y2IP, Y2T, Y2U, Y2V, Y2W, Y2X, or Y2Y) has a value less than the last two digits of the century window start year, the year field will be treated as a year in the century following the year of the century window, except for 00, which is considered to be in the same century as the century window start year. All other 2-digit years will be treated as in the same century as the century window start year.
For example, consider the century window 1950 through 2049. The 2-digit year fields would be processed as follows:
Two-digit Field |
Processed as Year |
|
|
|
|
|
|
|
|
|
|
An ascending sort of the above sample data would produce output data in the following sequence:
Two-digit Field |
Processed as Year |
|
|
|
|
|
|
|
|
|
|
If CENTWIN has been specified on the SORT or MERGE control statement as well as in the PARM field, the PARM specification has precedence.