DATE conversion to Gregorian



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

DATE conversion to Gregorian

Postby ajuatsgp » Sun Jan 13, 2013 12:13 pm

Hi,
I have a date field defined as S9(7) comp-3. It contains date in CCYYDDD format. I am trying to convert this date to Gregorian format as CCYY-MM-DD.
I have checked the manual z/OS V1R12.0 DFSORT Application Programming Guide; Table 49. TOJUL and TOGREG output date fields.
If my understanding of the table is not wrong then the DATE conversion I am trying can not be done.

Please let me know how to do the above DATE conversion.

Thanks
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DATE conversion to Gregorian

Postby NicC » Sun Jan 13, 2013 2:41 pm

You may have read the manuals - and not very carefully - but you obviously did not search the forum. Do so and you will find your solution in here.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: DATE conversion to Gregorian

Postby ajuatsgp » Sun Jan 13, 2013 3:35 pm

Dear Nic,
Would you mind telling me which part of Manual should I read again to solve my problem.
Also it would be kind of you ig you let me know the thread in this forum where similar type of problem is already discussed.

Thanks
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DATE conversion to Gregorian

Postby Akatsukami » Sun Jan 13, 2013 6:25 pm

ajuatsgp wrote:Also it would be kind of you ig you let me know the thread in this forum where similar type of problem is already discussed.

When I opened this thread, the very first "Related Topic" was "To obtain date in Gregorian format". Try reading that thread.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: DATE conversion to Gregorian

Postby ajuatsgp » Sun Jan 13, 2013 6:32 pm

Hi,
As I mentioned in my question my input date is in P'ccyyddd' format.
So using Y4X and TOGREG didn't work for me.
Can you tell what should I use?

Thanks
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DATE conversion to Gregorian

Postby tivrfoa » Sun Jan 13, 2013 6:42 pm

I think you can't use separator for COMP-3 (PD). You need first to convert to CH or ZD.
Or you can try in INREC TOGREG, and in the outrec place the separator(-)

I'm justing guessing ... I use SYNCSORT ... Please post your solution if you find it.

Maybe these links can help you:
http://www-01.ibm.com/support/docview.w ... g3T7000174

http://ibmmainframes.com/about18642.html
http://ibmmainframes.com/about46140.html

http://publib.boulder.ibm.com/infocente ... e1ca50.htm
http://publib.boulder.ibm.com/infocente ... a50305.htm
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: DATE conversion to Gregorian

Postby ajuatsgp » Sun Jan 13, 2013 10:45 pm

Hi,
I am still unable to figure out the solution.

Thanks
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DATE conversion to Gregorian

Postby BillyBoyo » Sun Jan 13, 2013 11:01 pm

Please show your JCL, Sort control cards, and full sysout from the step which failed.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: DATE conversion to Gregorian

Postby ajuatsgp » Sun Jan 13, 2013 11:58 pm

Dear Billy,
My sortcard looks likes below:
SORT FIELDS=(1,30,CH,A,56,4,CH,A)
INCLUDE COND=(56,4,CH,EQ,C'PSRA')
OUTREC FIELDS=(1:1,22,24:23,4,Y4U,TOGREG=Y4T(-),X,
        31:27,4,PD,TO=ZD,LENGTH=6,39:56,4)


My input file has length 545
My output file has length 42
Input file has date field which starts at 23 byte and defined as s9(7) comp-3. I have few other fields before and after the date field which is shown in the ontrol card
The sysout is shown below:
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE805I 1 JOBNAME: SAYLN11D , STEPNAME: XF1D1400
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 22:56 ON SAT JAN 12, 2013 -
           SORT FIELDS=(1,30,CH,A,56,4,CH,A)
           INCLUDE COND=(56,4,CH,EQ,C'PSRA')
           OUTREC FIELDS=(1:1,22,24:23,4,Y4U,TOGREG=Y4T(-),X,
                   31:27,4,PD,TO=ZD,LENGTH=6,39:56,4)
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE126A 2 INCONSISTENT REFORMATTING FOR *OUTREC : REASON CODE 04, IFTHEN 0
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 EE-K72040 E7-K70685
ICE052I 3 END OF DFSORT
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DATE conversion to Gregorian

Postby BillyBoyo » Mon Jan 14, 2013 4:04 am

Did you have a look at the message ICE126A? There is a DFSORT messages manual, or you can use IBM LookAt (google it, click from google, paste in the code, click, read).

You'll find that you have an overlapping field. You specify 24 as the starting column for your YYYYMMDD, then a blank, then attempt to start a field at column 31.

Go through the message. You don't have many fields, so it is easy. Go through it, so you don't have to ask next time.
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