Page 1 of 1

Date conversion from dd.mm.yyyy to Julian date

PostPosted: Tue Oct 18, 2011 1:37 am
by nikesh_rai


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

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

PostPosted: Tue Oct 18, 2011 2:02 am
by BillyBoyo
Which SORT product are you using? There is a forum here for DFSORT and also for SYNCSORT.

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

PostPosted: Tue Oct 18, 2011 2:37 am
by Frank Yaeger
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 

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

PostPosted: Tue Oct 18, 2011 12:55 pm
by nikesh_rai
Using DFSORT with FB file and LREC is 56. I will try this one

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

PostPosted: Wed Oct 19, 2011 2:12 am
by nikesh_rai
its working..thanks Frank