Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - julian date conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject:
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    Post subject: Reply to: can DFSORT convert a JUlian-date to mm-dd-yyyyy fo
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:

http://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    Post subject:
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 Moderator


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

PostPosted: Tue Oct 12, 2010 11:00 pm    Post subject:
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: 2276
Location: @my desk

PostPosted: Fri Oct 15, 2010 12:28 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us