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

Date calculation - is it possible?


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

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Wed Oct 28, 2009 1:07 am
Reply with quote

I need to create file with one record which will have two dates:
One is current date + 9 days and another date will be current date + 13 days.
Basically if job runs on 10/30, dates in file should be Nov 08 and Nov 12.
Please see below.

Code:
----+----1----+----2--
X2009-11-08X2009-11-12


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

Senior Member


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

PostPosted: Wed Oct 28, 2009 1:13 am
Reply with quote

rmd3003,

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                             
DUMMY RECORD                               
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                             
  SORT FIELDS=COPY                         
  INREC BUILD=(X,DATE1(-)+9,X,DATE1(-)+13) 
/*


this will create 1 record as follows. The current date today is 10/27/2009

Code:

 2009-11-05 2009-11-09 


if you want alphabet 'x' in between then use this

Code:

//SYSIN    DD *                                 
  SORT FIELDS=COPY                               
  INREC BUILD=(C'X',DATE1(-)+9,C'X',DATE1(-)+13)
/*                                             


this will generate
Code:

X2009-11-05X2009-11-09
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Wed Oct 28, 2009 1:31 am
Reply with quote

Skolusu, thanks a lot.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top