Page 1 of 1

Syncsort - Convert Julian Date to Gregorian Date.

PostPosted: Sat Jan 09, 2010 2:02 am
by ranga_subham
Hi,

Please help me to convert a Julian date to Gregorian date using Syncsort.

Input format:
2009001
2010001


Ouput:
2009-01-01
2010-01-01


Is this achievable using Syncsort v1.3?

Thanks.

Re: Syncsort - Convert Julian Date to Gregorian Date.

PostPosted: Sat Jan 09, 2010 2:56 am
by Alissa Margulies
Here is a SyncSort for z/OS 1.3 job that will do what you asked:
//SORT1 EXEC PGM=SORT,PARM='CENTWIN=80'
//SORTIN  DD *                             
2009001
2010001
//SORTOUT DD SYSOUT=*                     
//SYSOUT  DD SYSOUT=*                       
//SYSIN   DD *                               
  INREC BUILD=(3,5,Y2T,DT=(4MD-))         
  SORT FIELDS=COPY                         
/*   

Re: Syncsort - Convert Julian Date to Gregorian Date.

PostPosted: Sun Jan 10, 2010 6:00 pm
by ranga_subham
Hi,

Thank you. Can you please help me to understand the SYSIN card?

Why we are choosing starting position from 3rd column and length 5 here when actual value starts at 1st column?

Thanks.

Re: Syncsort - Convert Julian Date to Gregorian Date.

PostPosted: Mon Jan 11, 2010 9:26 pm
by Alissa Margulies
ranga_subham wrote:Why we are choosing starting position from 3rd column and length 5 here when actual value starts at 1st column?

Y2T data format processes dates with a 2-digit year. Therefore, it is not necessary to specify the first 2 positions of the 4-digit year. The century is then processed based on your CENTWIN option (either your installation default or runtime parameter). Since I did not know how your CENTWIN installation option is configured at your site, I specified CENTWIN=80 as a runtime PARM, which will give you a century window between 1930-2029. For more details regarding CENTWIN processing, please refer to Chapter 5 in the SyncSort for z/OS 1.3 Programmer's Guide for complete details of the PARM Options.

Re: Syncsort - Convert Julian Date to Gregorian Date.

PostPosted: Mon Jan 11, 2010 9:35 pm
by ranga_subham
Thanks you for the details.