|
View previous topic :: View next topic
|
| Author |
Message |
rajandhla
Active User
.jpg)
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
DFSORT doesn't have a built-in function for relative dates, but you can use REXX to create a DFSORT symbol for the relative date that you can use. For an example, see:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst03.html#t7r
I'm not a REXX expert, so I can't tell you how to do it for different types of dates, but I'm sure one of the REXX experts could if you don't know how to do it yourself. |
|
| Back to top |
|
 |
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
Let us know if you want some more help on this
Alain |
|
| Back to top |
|
 |
rajandhla
Active User
.jpg)
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
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
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
Here is what you are looking for.
I modified the rexx from
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 Developer

Joined: 15 Feb 2005 Posts: 7129 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:
Use [URL] BBCode for External Links |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|