CENTWIN - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054
Figure 1. CENTWIN Format

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:

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

  00

  2000

  01

  2001

  49

  2049

  50

  1950

  99

  1999

An ascending sort of the above sample data would produce output data in the following sequence:

Two-digit Field

Processed as Year

  50

  1950

  99

  1999

  00

  2000

  01

  2001

  49

2049

If CENTWIN has been specified on the SORT or MERGE control statement as well as in the PARM field, the PARM specification has precedence.