To obtain date in Gregorian format



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

To obtain date in Gregorian format

Postby kimir » Mon Mar 12, 2012 10:40 am

Hi,

I have a requirement wherein the output file should have the date format in Gregorian in the detail record without any separator(Eg 01122012 MMDDYYYY). I went thru the forum posts and found that &DATENS=(MD4) will provide the output in Julian format.
1) Is there any function to convert the date to Gregorian.
2)At a set position of the input file, another date is present in packed format(Julian date). I have used the below to unpack it. However the output stll comes in Julian format.Is there a way to unpack it and convert it to Gregorian MMDDYYYY format at the same time.
OUTREC=(20:90,04,PD,EDIT=(TTTTTTT))

The output format is:
0012282011 where 00 represents header record
01ABCDEFGHIJKLMNOP12282011

Note: 12282011 - MMDDYYYY format.

Regards,
Kimir.
kimir
 
Posts: 6
Joined: Sun Oct 23, 2011 7:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To obtain date in Gregorian format

Postby BillyBoyo » Mon Mar 12, 2012 1:11 pm

Check the manual/forum for TOGREG.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: To obtain date in Gregorian format

Postby Frank Yaeger » Tue Mar 13, 2012 12:01 am

Kimir,

1)

You didn't read the manual very carefully. &DATENS=(MD4) does give the date in Gregorian form, not Julian, e.g. it would give today's date as:

03122012

That is gregorian (mmddyyyy)

2)

Assuming you have a P'dddyyyy' date (Julian) in positions 90-93 of your input records, you can use the following DFSORT control statements to convert it to a 'mmddyyyy' date (Gregorian):

  OPTION COPY                               
  OUTFIL BUILD=(20:90,04,Y4X,TOGREG=(Y4W))   
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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post