Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

WEEKDAY=char3 with 8 digit date input.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Fri May 04, 2012 1:11 am    Post subject: WEEKDAY=char3 with 8 digit date input.
Reply with quote

hi,
followed a reply by sokulsu trying to get the weekday on a report. i can get saturday but i think maybe i am missing an option.

input:
Code:

03/20/2012 20120320


statements:
Code:

   OPTION COPY                                             
   INREC IFTHEN=(WHEN=INIT,BUILD=(342,04,PD0,X,             
           024,04,PD,EDIT=(IIIIIIIIIIT))),                 
         IFTHEN=(WHEN=INIT,BUILD=(3,2,C'/',5,2,C'/20',1,2,X,
                C'20',1,2,3,2,5,2,X,                       
                12,8,Y4T,WEEKDAY=CHAR9,                     
                         09,12))                           


output:
Code:

20120320 SATURDAY 
20120320 SATURDAY 
20120320 *********
20120320 *********
20120320 *********
20120320 *********
20120320 *********
20120320 *********
20120320 *********


looked pretty straight forward to me but...
thanks again.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 04, 2012 1:36 am    Post subject: Reply to: WEEKDAY=char3 with 8 digit date input.
Reply with quote

madmartinsonxx,

You need to realize how BUILD works. The Second BUILD is picking the edited value 024,04,PD,EDIT=(IIIIIIIIIIT) as input for weekday function and hence the asterisks as the dates may not be valid. You only got lucky where the edited number ended up as a valid date.

You have a very confusing way of getting things done. You are picking 2 fields and they are using only 1 field in the output.

I am guessing that your input fields are as below
Code:

pos 24 - 4 bytes of PD field
pos 342 - 4 bytes of Date field


Now just tell me what do you need in the output and we will show you a way to do it.
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Fri May 04, 2012 1:52 am    Post subject:
Reply with quote

yes, those are my fields. output should look like:

Code:

03/19/2012 20120319              7185482
03/19/2012 20120319              7185482
03/19/2012 20120319              7187205
03/19/2012 20120319              7187205
03/19/2012 20120319              7187205
03/19/2012 20120319              7185830
03/19/2012 20120319              7185296
03/20/2012 20120320              7189020
03/20/2012 20120320              7189020
03/20/2012 20120320              7189022
03/20/2012 20120320              7189025
03/20/2012 20120320              7189037
03/20/2012 20120320              7189037


..with weekday mneumonic just after the 8 byte date, call it the 3rd field, and before the last numeric field.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 04, 2012 2:12 am    Post subject: Reply to: WEEKDAY=char3 with 8 digit date input.
Reply with quote

madmartinsonxx,

Use the following control cards which will give you the desired results. I used Y2PAST=2000 as you said all your dates are greater than 2000. If you have 19xx dates then they can also be handled but differently.

Code:

//SYSIN    DD *                                             
  OPTION COPY,Y2PAST=2000                                   
                                                         
  INREC IFOUTLEN=40,IFTHEN=(WHEN=INIT,                     
  BUILD=(31:24,4,PD,M10,LENGTH=10,342,4,PD0)),               
  IFTHEN=(WHEN=INIT,OVERLAY=(43,2,C'/',45,2,C'/20',41,2,X,   
  41,6,Y2T,TOGREG=Y4T,X,41,6,Y2T,WEEKDAY=CHAR9))             
//*


The output from the above control cards is

Code:

mm/dd/ccyy ccyymmdd 9-charday IIIIIIIIIT 
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Fri May 04, 2012 2:54 am    Post subject:
Reply with quote

thank you. guess i can scratch this one from my bucket list ! cheers.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us