IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort "Y2C" Function


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cz016m

New User


Joined: 09 Mar 2016
Posts: 9
Location: United States

PostPosted: Tue Jan 04, 2022 9:42 pm
Reply with quote

Happy New Year!

My shop currently uses Syncsort for z/OS 3.1.0.0R.

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):
Code:

211217
211210
211224


Code:

  SORT FIELDS=(1,9,CH,A,57,8,CH,A)
OUTREC FIELDS=(001,09,
               001X,
               091,11,
               001X,
               010,25,
               001X,
               102,07,
               001X,
               109,02,Y2C,        * Convert YY to CCYY
               111,04,            * MMDD
               001X,
               66:SEQNUM,6,ZD,
               009X)


From November 1st, 2020 thru December 1st, 2021, the output looked like this (CCYYMMDD) in positions 57-64:
Code:

20211217
20211210
20211224

As of 1/1/2022, the output looks like this (CCYYMMDD) in positions 57-64:
Code:

21211217
21211210
21211224


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?
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1414

PostPosted: Tue Jan 04, 2022 10:06 pm
Reply with quote

Y2C conversion is controlled by the parameter CENTWIN=
It can be specified either explicitly, or a default system value used if missing.
Quote:
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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts FUNCTION NUMVAL problem COBOL Programming 5
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
No new posts I don't really get the, "Start a... General Talk & Fun Stuff 3
No new posts defining a global LUA function in Inf... IBM Tools 1
Search our Forums:

Back to Top