MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Julian date conversion in SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Thu Dec 15, 2011 8:27 am    Post subject: Julian date conversion in SORT Reply with quote

I am having date in input file in format 'YYYY-MM-DD' in position 38.

I want to convert it to Julian date 'YYYYDDD' to picture clause S9(07) COMP-3.

I tried with below SORT card but not getting correct result.


Code:

OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,2,BI,TO=ZD,LENGTH=3,         
                                3,2,BI,TO=ZD,LENGTH=3,         
                                5,19,                         
                                52,23,                         
                                32,6,                         
                                38,10,UFF,TO=ZD,LENGTH=8,     
                                24,8,                         
                                48,2,BI,TO=ZD,LENGTH=4,       
                                48,2,BI,TO=ZD,LENGTH=4)),     
       IFTHEN=(WHEN=INIT,BUILD=(1,54,55,8,Y4T,TOJUL=Y4T,63,16))


Please help to provide correct solution.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Dec 15, 2011 11:29 am    Post subject: Re: Julian date conversion in SORT Reply with quote

psmadhusudhan wrote:

I want to convert it to Julian date 'YYYYDDD' to picture clause S9(07) COMP-3.
BUILD=(1,54,55,8,Y4T,TOJUL=Y4T,63,16))



If you want the julian date in packed decimal format you need to use Y4U instead of Y4T on the output side.

So change your control cards to
Code:

BUILD=(1,54,55,8,Y4T,TOJUL=Y4U,63,16))


Check this link which explains the various output formats of TOJUL and TOGREG functions

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/3.15?DT=20110608113434#TBLTATODF
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group