View previous topic :: View next topic
|
Author |
Message |
dheeraj.ramchandani
New User
Joined: 03 Sep 2015 Posts: 10 Location: Peru
|
|
|
|
I have a PD date field in julian CCYYDDD format and I want to extract records with date higher than current date and print them with converted gregorian date DDMMCCYY or MMDDCCYY. I am able to extract records with date higher than current date using DATE3P but unable to convert them using TOGREG. Please find the sysout below: -
Code: |
********************************* TOP OF DATA **********************************
ICE805I 1 JOBNAME: XXXXXXX , STEPNAME: STEPXXX
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 09:51 ON THU NO
SORT FIELDS=COPY
INCLUDE COND=(67,4,PD,GT,DATE3P)
OUTREC BUILD=(1:67,4,Y4T,TOGREG=Y4W)
$
ICE111A E REFORMATTING FIELD ERROR
ICE751I 0 C5-K76982 C6-K90026 C7-K94453 C8-K94453 E7-K95469
ICE052I 3 END OF DFSORT
******************************** BOTTOM OF DATA ********************************
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Y4T is an eight-position character/zoned-decimal field. You have four bytes of packed-decimal, so that's not going to work. You need Y4U.
When using the date-formats, you need to have specified the correct length, and the data needs to be in the correct format.
Using the system-date is bad. How will you do a re-run, or test to specific dates? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Shouldn't that be:
Code: |
OUTREC BUILD=(1:67,4,Y4U,TOGREG=Y4W) |
?? IFIRC, Y4T expects an 8-byte ZD field but your field is packed.
Garry |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Garry just missed to see Bill's reply but apprently both have the same answers.. |
|
Back to top |
|
|
dheeraj.ramchandani
New User
Joined: 03 Sep 2015 Posts: 10 Location: Peru
|
|
|
|
Bill Woodger wrote: |
Y4T is an eight-position character/zoned-decimal field. You have four bytes of packed-decimal, so that's not going to work. You need Y4U.
When using the date-formats, you need to have specified the correct length, and the data needs to be in the correct format.
Using the system-date is bad. How will you do a re-run, or test to specific dates? |
Thanks Bill, it worked. I did not know about Y4U. In fact, I would like to have a document which explains all the Y4x and Y2x fields. The DFSort and ICETOOL docs are not of much help.
I need to create an adhoc process where I need to extract records having date more than current date. I can run that whenever there is a requirement.
Garry Carroll wrote: |
Shouldn't that be:
Code: |
OUTREC BUILD=(1:67,4,Y4U,TOGREG=Y4W)
|
?? IFIRC, Y4T expects an 8-byte ZD field but your field is packed. |
Thanks Garry.
I am getting date as MM/DD/CCYY, what if I want DD/MM/CCYY? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Consult the DFSORT Application Programming Guide, everything is documented. If you have complaints about the format or content, IBM are happy for you to contact them. I really can't see at all how you can think the documentation doesn't help. I suspect in your searching you've accidentally found one of the stupid-dumb "blogs" written by people who know nothing, rather than the actual documentation.
To get DD/MM/YYYY you're going to have to start with MM/DD/YYYY and rearrange it with code. |
|
Back to top |
|
|
dheeraj.ramchandani
New User
Joined: 03 Sep 2015 Posts: 10 Location: Peru
|
|
|
|
Thanks a lot Rohit and Bill, I will again try to find out in the documents mentioned by you and get back to you if I encounter any problem. I have all the docs suggested by you. |
|
Back to top |
|
|
|