Convert 7 digit Julian date to DD-MMM-YYYY format



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Convert 7 digit Julian date to DD-MMM-YYYY format

Postby Farhaan4mf » Wed Jul 02, 2014 1:51 pm

Hi,
I have gone through DFsort manual on Julian date conversion but could not implement it properly while practicing.
Julian dates are in a flat file ( LRECL=93, RECFM=FB). Position col 87-93
dates are as below
2013180
2014070
2014180
2014179
2015090
2016059
Needs to change to DD-MMM-YYYY format (example 29-JUN-2014). Please give me the DFSORT code to do this. (note: all the dates are in 20xx years. there are no dates having 19xx years)
Farhaan4mf
 
Posts: 29
Joined: Mon May 13, 2013 4:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Convert 7 digit Julian date to DD-MMM-YYYY format

Postby BillyBoyo » Wed Jul 02, 2014 2:00 pm

What have you tried, and what were the results?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Convert 7 digit Julian date to DD-MMM-YYYY format

Postby Farhaan4mf » Wed Jul 02, 2014 5:23 pm

Hi Billy,
I tried the below sort card
 OPTION COPY                         
 OUTREC BUILD=(51,7,Y4T,TOGREG=Y4W(-))

Results are in
mm-dd-yyyy format. But I want in DD-MMM-YYYY format. Is it possible using DFSORT. I do not know how...
Farhaan4mf
 
Posts: 29
Joined: Mon May 13, 2013 4:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Convert 7 digit Julian date to DD-MMM-YYYY format

Postby BillyBoyo » Wed Jul 02, 2014 6:17 pm

I don't think there's anything to do that directly.

You can look in the Smart DFSORT Tricks publication for "Sort ddmonyy dates", which will give you code to convert month-number to month-abbreviation. That plus just shuffling around should get you there.

Use INREC, put your existing BUILD on an IFTHEN=(WHEN=NONE, and a new BUILD to do the change and the shuffling.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post