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

Incrementing a Date field by One Day


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

New User


Joined: 20 Dec 2006
Posts: 2
Location: Bangalore, India

PostPosted: Tue Feb 20, 2007 7:01 pm
Reply with quote

I need to develop a job with the following criteria:
I have an input file containing a date (Run Date) and another one containing input data with a date field in all records.

E.g.

Run Date File
2007-02-20

Input file
abcdxxxx2007-02-21
abcdxxxx2007-02-20
abcdyyyy2007-02-21

I need to extract all the records from this input file having a date field equal to the Run Date + 1 Day(i.e. 2007-02-21).
Is it possible to increment the Run date by one day using DFSORT directly?
Please note that i will not be using the System Date for the Run Date file

Basu
Back to top
View user's profile Send private message
Alan Voss

New User


Joined: 29 Nov 2006
Posts: 32
Location: Jacksonville, FL

PostPosted: Tue Feb 20, 2007 7:27 pm
Reply with quote

Can your input date file have two dates in it, one to signify the run date and one to signify the extract date? Or, can you just specify the extract date and use the system date for the run date?
Back to top
View user's profile Send private message
basu_b

New User


Joined: 20 Dec 2006
Posts: 2
Location: Bangalore, India

PostPosted: Tue Feb 20, 2007 7:36 pm
Reply with quote

Sorry Alan,

The Input date file would contain only one date and it is quite possible that it may be much before the System Date.
I am afraid I cannot use the system date in any way in the job.
I just wanted to know if DFSORT can handle Date manipulations on non-system dates. Would make life a lot easier if it were so icon_biggrin.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Feb 20, 2007 9:31 pm
Reply with quote

Sort products do not have any built-in functions for doing arithmetic on date fields in records.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Oct 30, 2010 1:02 am
Reply with quote

basu_b,

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010), you can use parm to pass values via parm and also add days to a given date.

Code:

//STEP0100 EXEC PGM=SORT,PARM='JP1"2007-02-20"'             
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
----+----1----+----2----+----3----+----4----+----5----+----6-
ABCDXXXX2007-02-21                                           
ABCDXXXX2007-02-20                                           
ABCDYYYY2007-02-21                                           
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:JP1)),                 
  IFTHEN=(WHEN=INIT,OVERLAY=(81:81,10,UFF,M11,LENGTH=8,     
               89:81,8,Y4T,ADDDAYS,+1,TOGREG=Y4T(-)))       
                                                             
  OUTFIL INCLUDE=(09,10,CH,EQ,89,10,CH),BUILD=(1,80)         
//*


The output from this job is
Code:

ABCDXXXX2007-02-21
ABCDYYYY2007-02-21



For complete details on the new DFSORT and ICETOOL functions available with the Oct, 2010 PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
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
Search our Forums:

Back to Top