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

WEEKDAY=char3 with 8 digit date input.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top