IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reformatting field, error while using date func


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dheeraj.ramchandani

New User


Joined: 03 Sep 2015
Posts: 10
Location: Peru

PostPosted: Thu Nov 05, 2015 8:30 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 05, 2015 8:56 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Nov 05, 2015 9:01 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Nov 05, 2015 9:51 pm
Reply with quote

Garry just missed to see Bill's reply but apprently both have the same answers.. icon_biggrin.gif
Back to top
View user's profile Send private message
dheeraj.ramchandani

New User


Joined: 03 Sep 2015
Posts: 10
Location: Peru

PostPosted: Fri Nov 06, 2015 2:33 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Nov 06, 2015 3:19 am
Reply with quote

Quote:
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.


If you Google it , you should find right away or look at the top "Manual".
Look what I have found it,
www-01.ibm.com/support/knowledgecenter/#!/SSLTBW_2.1.0/com.ibm.zos.v2r1.iceg200/cvtdf.htm
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 06, 2015 2:20 pm
Reply with quote

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
View user's profile Send private message
dheeraj.ramchandani

New User


Joined: 03 Sep 2015
Posts: 10
Location: Peru

PostPosted: Fri Nov 06, 2015 7:47 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top