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
 

 

Incrementing a Date field by One Day

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Incrementing a Date field by One Day
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Feb 20, 2007 9:31 pm    Post subject:
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    Post subject: Reply to: Incrementing a Date field by One Day
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:

http://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    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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
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


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