Page 1 of 1

DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 12:13 pm
by ajuatsgp
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

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 2:41 pm
by NicC
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.

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 3:35 pm
by ajuatsgp
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

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 6:25 pm
by Akatsukami
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.

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 6:32 pm
by ajuatsgp
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

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 6:42 pm
by tivrfoa
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

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 10:45 pm
by ajuatsgp
Hi,
I am still unable to figure out the solution.

Thanks

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 11:01 pm
by BillyBoyo
Please show your JCL, Sort control cards, and full sysout from the step which failed.

Re: DATE conversion to Gregorian

PostPosted: Sun Jan 13, 2013 11:58 pm
by ajuatsgp
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

Re: DATE conversion to Gregorian

PostPosted: Mon Jan 14, 2013 4:04 am
by BillyBoyo
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.