Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Inlcude past date in YY/MM/DD format

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

New User


Joined: 10 Nov 2009
Posts: 3
Location: Edinburgh

PostPosted: Tue Nov 10, 2009 9:19 pm    Post subject: Inlcude past date in YY/MM/DD format
Reply with quote

I need to include current date minus 7 days in YY/MM/DD format in my output records.

I can use DATE1(/)-7 to get the correct date with 4 char year 2009/11/03

I can use DATE=(YMD/) to get current date with 2 char year 09/11/10, but I can't see a way to get this format for a date in the past.

Thanks, Ian
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 11, 2009 12:32 am    Post subject:
Reply with quote

Quote:
I can use DATE1(/)-7 to get the correct date with 4 char year 2009/11/03


Use DATE1(/)-7 to get 'ccyy/mm/dd' - then rebuild it as 'yy/mm/dd'. For example:

Code:

  OPTION COPY                                           
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,80,81:DATE1(/)-7)), 
    IFTHEN=(WHEN=INIT,BUILD=(1,80,81:83,8))             
Back to top
View user's profile Send private message
itclark

New User


Joined: 10 Nov 2009
Posts: 3
Location: Edinburgh

PostPosted: Wed Nov 11, 2009 6:56 pm    Post subject:
Reply with quote

Thanks for that Frank.
I wasn't specific enough with my original query as I only need to include the date on some of the output records, but I have used your suggestion to get the following which works perfectly.

Code:

   INREC IFTHEN=(WHEN=(5,7,CH,EQ,C'GCMIGDE'),         
                   BUILD=(1,21,DATE1(/)-7,30,6))   
   OUTREC IFTHEN=(WHEN=(5,7,CH,EQ,C'GCMIGDE'),       
                  BUILD=(1,21,22:24,43))


Regards, Ian
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 11, 2009 11:28 pm    Post subject:
Reply with quote

Note that you don't need an INREC and OUTREC statement to do this. You can do it with just one of them. For example:

Code:

  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(5,7,CH,EQ,C'GCMIGDE'),                   
                   BUILD=(1,21,DATE1(/)-7,30,6),HIT=NEXT),     
     IFTHEN=(WHEN=ANY,BUILD=(1,21,22:24,43))                   
Back to top
View user's profile Send private message
itclark

New User


Joined: 10 Nov 2009
Posts: 3
Location: Edinburgh

PostPosted: Thu Nov 12, 2009 3:03 pm    Post subject:
Reply with quote

Thanks Frank - that's perfect.
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 the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us