MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
psmadhusudhan Beginner Joined: 28 Nov 2006 Posts: 143 Topics: 48
Posted: Thu Dec 15, 2011 8:27 am Post subject: Julian date conversion in SORT
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Dec 15, 2011 11:29 am Post subject: Re: Julian date conversion in SORT
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
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