Joined: 09 Mar 2016 Posts: 9 Location: United States
Happy New Year!
My shop currently uses Syncsort for z/OS 220.127.116.11R.
I have been running the following Syncsort on the first of every month since November 1st, 2020. I'm reformatting the input file and converting a 6-digit date (YYMMDD) to an 8-digit date (CCYYMMDD). Up until now, the Y2C function that I used has produced "20" as the century and the resulting output dates have been correct. As of January 1st, 2022, the Y2C function started producing "21" as the century and my dates are wrong and it is causing issues in my application.
As an example, the two digit input year was "21" and the resulting output century and year (CCYY) were "2021". As of January 1st, 2022, the two digit input year is still "21", but the resulting output century and year (CCYY) are now "2121". I don't understand why the century changed from 20 to 21. Perhaps I shouldn't be using the Y2C function, but it has worked up until now.
The input is FB 314 with all character data and I'm only illustrating a portion of it for simplicity's sake. Input data sample for positions 109-114 (YYMMDD):
From November 1st, 2020 thru December 1st, 2021, the output looked like this (CCYYMMDD) in positions 57-64:
As of 1/1/2022, the output looks like this (CCYYMMDD) in positions 57-64:
I didn't make any code changes and the input data format didn't change. The only thing I can think of that changed was the current year from 2021 to 2022. Why did the year changing from 2021 to 2022 impact Y2C output? Can anyone help me understand what I'm doing wrong? Do you have any suggestions on a better way to code this to prevent this from happening again?
Y2C conversion is controlled by the parameter CENTWIN=
It can be specified either explicitly, or a default system value used if missing.
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 currentyear 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.