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

Syncsort - julian date conversion


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shanthi Jayaraman

New User


Joined: 11 Jun 2007
Posts: 26
Location: Malaysia

PostPosted: Tue Oct 12, 2010 5:08 pm
Reply with quote

Hi, I've been using the below codes for sometime but recently discovered some issue which am not able to understand why. Something to do with the data (only happens for some records in the year 2000 - 2010).

Code:
* IF YY > 49, CONVERT Z'YYDDD' TO X'00YYDDDC'                         
  INREC IFTHEN=(WHEN=(26,2,ZD,GT,+49,OR,34,2,ZD,GT,+49,OR,54,2,ZD,GT,
    +49),                                                             
    BUILD=(1,23,X'00',26,5,ZD,TO=PD,LENGTH=3,31,1,X'00',34,5,ZD,TO=PD,
    LENGTH=3,39,13,X'00',54,5,ZD,TO=PD,LENGTH=3,59,13)),             
* IF YY <= 49, CONVERT Z'YYDDD' TO X'01YYDDDC'                       
        IFTHEN=(WHEN=NONE,                                           
    BUILD=(1,23,X'01',26,5,ZD,TO=PD,LENGTH=3,31,1,X'01',34,5,ZD,TO=PD,
    LENGTH=3,39,13,X'01',54,5,ZD,TO=PD,LENGTH=3,59,13))               
* CONVERT X'00YYDDDC' TO Z'19YYMMDD'.                                 
* CONVERT X'01YYDDDC' TO Z'20YYMMDD'.                                 
* OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,23,24,4,DT1,28,1,29,4,DT1,33,13, 
*   46,4,DT1,50,13)),                                                 
* CONVERT Z'CCYYMMDD' TO C'DDMMCCYY'.                                 
*  IFTHEN=(WHEN=INIT,                                                 
*   BUILD=(1,23,24,8,32,1,33,8,41,13,54,8,62,13))                     
* END


Input Data :
xxx;xxxxxxxxxxxxxxxx;x;2000026;2000080;xxxxxxxxxxx;1999364;xxxxxxxxxxx;

xxx;xxxxxxxxxxxxxxxx;x;2010047;2010047;xxxxxxxxxxx;1999041;xxxxxxxxxxx;

Output Data :
xxx;xxxxxxxxxxxxxxxx;x;19000126;19000321;xxxxxxxxxxx;19991230;xxxxxxxxxxx;

xxx;xxxxxxxxxxxxxxxx;x;19100216;19100216;xxxxxxxxxxx;19990210;xxxxxxxxxxx;
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 12, 2010 9:58 pm
Reply with quote

Shanthi Jayaraman,

I have no clue as to what you are doing. Your comments and does not match your input.

Why are you using a Y2K window logic when your dates already have a century in the input.

Looks like your input is 7 byte Y4T format which CCYYDDD(julian format) and you want to convert it to CCYYMMDD (gregorian format)

DFSORT now supports the conversions between Julian and Gregorian formats.

You can use the following control cards

Code:

//SYSIN    DD *                             
  OPTION COPY                               
  INREC BUILD=(01,23,                       
               24,7,Y4T,TOGREG=Y4T,         
               31,1,                         
               32,7,Y4T,TOGREG=Y4T,         
               39,13,                       
               52,7,Y4T,TOGREG=Y4T,         
               59,13)                       
//*


The output from this is
Code:

XXX;XXXXXXXXXXXXXXXX;X;20000126;20000320;XXXXXXXXXXX;19991230;XXXXXXXXXXX;
XXX;XXXXXXXXXXXXXXXX;X;20100216;20100216;XXXXXXXXXXX;19990210;XXXXXXXXXXX;


For complete details on date conversion functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
Back to top
View user's profile Send private message
Shanthi Jayaraman

New User


Joined: 11 Jun 2007
Posts: 26
Location: Malaysia

PostPosted: Tue Oct 12, 2010 10:57 pm
Reply with quote

Hi Skolusu,

Thanks for the reply...this doesn't work at my place as we are using SYNCSORT icon_sad.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 12, 2010 11:00 pm
Reply with quote

Quote:
this doesn't work at my place as we are using SYNCSORT


If you are using Syncsort, why did you post in the DFSORT Forum?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Oct 15, 2010 12:28 pm
Reply with quote

Shanthi Jayaraman,

Syncsort topics are discussed in the JCL forum.

Looks like you could make use of the DTNS parameter to make this work for input years in a century window of your choice. I have chosen the CENTWIN parameter as 1980 which works for years 1980 - 2079. You can modify this if needed.
Code:
//STEP01 EXEC PGM=SORT,PARM='CENTWIN=1980'
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN= Input file  FB/80
//SORTOUT  DD DSN= Output file FB/80
//SYSIN    DD *                                         
  OPTION COPY
  INREC BUILD=(01,23,26,5,Y2T,DTNS=(4MD),
               31,01,34,5,Y2T,DTNS=(4MD), 
               39,13,54,5,Y2T,DTNS=(4MD),59,22)
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top