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 

Convert from julian to Gregorian formate

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


Joined: 11 Apr 2007
Posts: 4
Topics: 2

PostPosted: Mon Apr 30, 2007 1:07 am    Post subject: Convert from julian to Gregorian formate Reply with quote

HOw to covert from Julian date(2007119) to Gregorian(2007/04/29) date using JCL.

I have an input contains like Current date,next date are in Julian formate.

2007119 2007120


I want display report(from julian to Gregorian) like:

Current_date Next-Date
2007/04/29 2007/04/30


Can any one let me know how to slove this problem.
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Mon Apr 30, 2007 2:48 am    Post subject: Reply with quote

What do you mean by "using JCL"?

O.
________
marijuana medical


Last edited by ofer71 on Sat Feb 05, 2011 12:00 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Jai Prakash
Beginner


Joined: 11 Apr 2007
Posts: 4
Topics: 2

PostPosted: Mon Apr 30, 2007 3:24 am    Post subject: Reply with quote

JCL means any utilities(not using by cobol pgm,Eztrieve).
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Apr 30, 2007 4:16 am    Post subject: Reply with quote

JCL is a laguage - specifically for running programs. It is NOT a program of ANY description
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Apr 30, 2007 5:42 am    Post subject: Reply with quote

Jai Prakash,

Realized that you wanted the reverse of what is shown in this link . sorry

Please SEARCH before posting. Check this link

http://mvsforums.com/helpboards/viewtopic.php?p=18528&highlight=julian

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Apr 30, 2007 10:56 am    Post subject: Reply with quote

Jai,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
2007119 2007120
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
* Convert 'ccyyddd' to X'01yydddC'.
    BUILD=(1:X'01',3,5,ZD,TO=PD,LENGTH=3,
           5:X'01',11,5,ZD,TO=PD,LENGTH=3)),
* Convert X'01yydddC' to C'ccyy/mm/dd'
   IFTHEN=(WHEN=INIT,
    BUILD=(1,4,DT1,EDIT=(TTTT/TT/TT),X,
           17:5,4,DT1,EDIT=(TTTT/TT/TT)))
  OUTFIL REMOVECC,
    HEADER1=('Current_date',17:'Next-Date')
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Nov 16, 2009 2:40 pm    Post subject: Reply with quote

Jai Prakash,

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707, you can use the new date conversion function TOGREG like shown below to get the desired results
Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
2007119 2007120                                                 
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC BUILD=(3:1,7,Y4T,TOGREG=Y4T(/),X,9,7,Y4T,TOGREG=Y4T(/))
  OUTFIL REMOVECC,HEADER1=('CURRENT_DATE  NEXT_DATE')       
//*

The output is
Code:

CURRENT_DATE  NEXT_DATE
  2007/04/29 2007/04/30


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
_________________
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