|
View previous topic :: View next topic
|
| Author |
Message |
rohanatl
New User
.jpg)
Joined: 21 Oct 2005 Posts: 22
|
|
|
|
Hi All,
Please help me to solve the requirement, From the input file we have to pull records in the date range( greater or equal june-01-2007 and less or equal OCT-31-2010)
Sample file
in_date(mmddyy)...
1----- 6---------------80
102907
110507
121108
111908
120309
121008
121508
I tried with the below code but , not giving the correct results.
sort fileds=copy
include cond=(1,6,ZD,GT,060107 and 1,6,ZD,LE,083110)
120309 is GT 060107 but its not LT 083110
Please let me know how we can pull the records in the date range mention ie GE,060107 and LE, 083110 |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
rohanatl,
You need to use Y2W format instead of ZD format. Isn't OCT the 10th month of the year? You say october and you use 08 as month. use the following DFSORT JCL. use Y'date' in yymmdd format to compare.
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
052907
102907
110507
121108
111908
120309
121008
121508
111510
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,6,Y2W,GE,Y'070601',AND,1,6,Y2W,LE,Y'101031')
//* |
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I came up with the same solution as Kolusu, but used:
| Code: |
OPTION COPY,Y2PAST=1980
|
to make sure the century window was ok (1980-2079). |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|