|
View previous topic :: View next topic
|
| Author |
Message |
basu_b
New User
Joined: 20 Dec 2006 Posts: 2 Location: Bangalore, India
|
|
|
|
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 |
|
 |
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 32 Location: Jacksonville, FL
|
|
|
|
| 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 |
|
 |
basu_b
New User
Joined: 20 Dec 2006 Posts: 2 Location: Bangalore, India
|
|
|
|
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  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Sort products do not have any built-in functions for doing arithmetic on date fields in records. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
|
|