Date conversion from dd.mm.yyyy to Julian date



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Date conversion from dd.mm.yyyy to Julian date

Postby nikesh_rai » Tue Oct 18, 2011 1:37 am



Hi,

Is there any way to convert date in Julian format from dd.mm.yyyy.
I know how to format mm.dd.yyyy to Julian date

I tried
SORT FIELDS=COPY
INREC OVERLAY=(13:13,10,Y4W,TOJUL=Y4T)

But giving JCL Error with REFORMATTING FIELD ERROR msg. Can any one help me in this regard
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Date conversion from dd.mm.yyyy to Julian date

Postby BillyBoyo » Tue Oct 18, 2011 2:02 am

Which SORT product are you using? There is a forum here for DFSORT and also for SYNCSORT.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Date conversion from dd.mm.yyyy to Julian date

Postby Frank Yaeger » Tue Oct 18, 2011 2:37 am

nikesh_rai,

You have to convert dd.mm.yyyy to mmddyyyy before you can convert it to Julian. You can use a DFSORT job like the following. I assumed your input file has RECFM=FB and LRECL=80, but you can change the job appropriately for other attributes:

//S1 EXEC PGM=SORT                                 
//SYSOUT DD SYSOUT=*                               
//SORTIN DD *                                       
AAAAAAAAAAAA31.12.2011BBBBBBBBBBBB       
AAAAAAAAAAAA17.10.2011BBBBBBBBBBBB               
//SORTOUT DD SYSOUT=*                               
//SYSIN DD *                                       
  SORT FIELDS=COPY                                 
  INREC IFOUTLEN=80,                               
    IFTHEN=(WHEN=INIT,OVERLAY=(81:16,2,13,2,19,4,   
      13:81,8,Y4W,TOJUL=Y4T,3X))                   


SORTOUT would have:

AAAAAAAAAAAA2011365   BBBBBBBBBBBB 
AAAAAAAAAAAA2011290   BBBBBBBBBBBB 
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Date conversion from dd.mm.yyyy to Julian date

Postby nikesh_rai » Tue Oct 18, 2011 12:55 pm

Using DFSORT with FB file and LREC is 56. I will try this one
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Date conversion from dd.mm.yyyy to Julian date

Postby nikesh_rai » Wed Oct 19, 2011 2:12 am

its working..thanks Frank
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post