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
 

 

How to convert gregorian date to julian

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Thu Jun 17, 2010 8:24 pm    Post subject: How to convert gregorian date to julian
Reply with quote

Hi,

I have date in the input file of format C'YYYYMMDD' How to convert this into Julian date as C'YYYYDDD'

Please help me out.
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Thu Jun 17, 2010 9:00 pm    Post subject:
Reply with quote

See if this works for you. For some strange reason its showing Blank output for me.

Could someone please correct me if its wrong? I used latest DFSort Manual to get this example.


Code:
//SORT01   EXEC PGM=SORT                       
//SORTIN   DD *                               
20100110                                       
//SORTOUT  DD  SYSOUT=*                       
//SYSIN    DD *                               
 SORT FIELDS=COPY                             
 OUTREC BUILD=(01,08,Y4T,TOJUL=Y4U)           
/*                                             
//SYSOUT DD SYSOUT=*                           


Thanks,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 17, 2010 9:10 pm    Post subject:
Reply with quote

Hello,

Posting the sysout info from the sort would help. . .
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jun 17, 2010 9:12 pm    Post subject: Reply to: How to convert gregorian date to julian
Reply with quote

ABaluchamy,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT               
//SYSOUT   DD SYSOUT=*                 
//SORTIN   DD *                         
20100609                               
20100617                               
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                         
  SORT FIELDS=COPY                     
  INREC OVERLAY=(10:1,8,Y4T,TOJUL=Y4T) 
//*



The output from this job is

Code:

20100609 2010160
20100617 2010168                                 


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

Quote:

See if this works for you. For some strange reason its showing Blank output for me.

Could someone please correct me if its wrong? I used latest DFSort Manual to get this example.


Sqlcode1,

I do understand that you are eager to help , but please understand the features before you can help. It only adds confusion by posting something which you think does not work even though it works as it is supposed to work. OP wanted a Julian date in CHARACTER format which is the Y4T format(C'ccyyddd'). Y4U is a packed decimal format(P'ccyyddd') which you cannot read unless you turn on the hex format.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
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


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