|
|
| Author |
Message |
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 183 Location: Hyderabad
|
|
|
|
Hi All,
I have a requirement. I need to compare the dates in a dataset (i.e. the records that fall between the current date and current date+16 days) and extract those records.
I'm stucking at how to get current date+16 day.
Please let me know if it possible. I'm using INCLUDE OPTION.
Date format is YYDDD.
Regards
Jai |
|
| Back to top |
|
 |
References
|
Posted: Tue Dec 20, 2005 8:00 pm Post subject: Re: Extraction of data between date ranges. |
 |
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3908 Location: San Jose, CA
|
|
| Back to top |
|
 |
Alain Benveniste
Active User
Joined: 14 Feb 2005 Posts: 89
|
|
|
|
Let us know if you want some more help on this
Alain |
|
| Back to top |
|
 |
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 183 Location: Hyderabad
|
|
|
|
Hi Alian,
I don't have idea on rexx as frank suggested to use, but also there is no bulit in function in sort.
Can you help me how to proceed, if possible using sort.
Thanks & Regards
Jai |
|
| Back to top |
|
 |
Alain Benveniste
Active User
Joined: 14 Feb 2005 Posts: 89
|
|
|
|
Here is what you are looking for.
I modified the rexx from
http://search390.techtarget.com/tip/1,289483,sid10_gci817030,00.html
to your specific need.
Play with ADD_DAYS to do your own tests.
I have coded some SAY in the rexx to check the result.
At this time DATE rexx function in MVS (and VM) can't do that as easily as shown in the Frank's smart trick.
So, that's why I was late to reply to your need : I have opened 2 PMR (?) to suggest the rexx team to implement this.
I wait for the feedback if they accept or not to extend that 'new' functions in VM & MVS.
| Code: |
/* REXX */
ADD_DAYS=9
Julian_Date=SUBSTR(DATE("S",DATE("B")+ADD_DAYS,"B"),3,2)!!RIGHT(DATE("B",DATE("B")+ADD_DAYS,"B")-DATE("B",SUBSTR(DATE("S",DATE("B")+ADD_DAYS,"B"),1,4)"0101","S")+1,3,"0")
say "Standard Date: "DATE("S",Julian_Date,"J")
say "european Date: "DATE("E",Julian_Date,"J")
say "USA Date : "DATE("U",Julian_Date,"J")
say "Julian Date : "Julian_Date
QUEUE "JDATE,C'"Julian_Date"'"
"EXECIO 1 DISKW OUT"
|
Here is a sample:
| Code: |
//STEP0001 EXEC PGM=IKJEFT01,PARM=(XDATE)
//SYSEXEC DD DISP=SHR,DSN=...
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//OUT DD DSN=&&OUT,
// DISP=(NEW,PASS,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,0,0)),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80)
//SYSTSIN DD DUMMY
//*
//STEP0002 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//SYMNAMES DD DSN=&&OUT,DISP=(SHR,DELETE,DELETE)
//TOOLIN DD *
COPY FROM(IN) TO(OUTX) USING(ICE0)
/*
//IN DD *
05350
05360
06001
06002
/*
//OUTX DD SYSOUT=*
//ICE0CNTL DD *
INCLUDE COND=(1,5,CH,GE,JDATE)
/*
|
Alain |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3908 Location: San Jose, CA
|
|
|
|
| Quote: |
| DFSORT doesn't have a built-in function for relative dates |
It does now with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). For example:
| Code: |
INCLUDE COND=(1,5,Y2T,GE,Y'DATE3',AND,
1,5,Y2T,LE,Y'DATE3'+16)
|
For complete details on comparing and inserting past and future dates, see:
www.ibm.com/servers/storage/support/software/sort/mvs/peug/ |
|
| Back to top |
|
 |
|
|
|