Page 1 of 1

Date Range Selection Using SORT.

PostPosted: Thu Feb 05, 2015 7:42 pm
by Vineet
Hi All,
I have a file with high vol. of Data. There is a Date Field also. There are 2 requirements.

1) I need to select all records which are less than CURRENT DATE.
2) Need to Select all records where Date >= CURRENT DATE + 63 Days.

All Extracted records to be written to a seperate file. O/P file have same attribute as Input file.

Date is in Format YYYY-MM-DD.

Thanks
Kind Rgd's

Re: Date Range Selection Using SORT.

PostPosted: Thu Feb 05, 2015 7:57 pm
by BillyBoyo
So have a look at INCLUDE COND= and see where you get with that.

Re: Date Range Selection Using SORT.

PostPosted: Fri Feb 06, 2015 4:40 am
by Vineet
Hi All,
Let me place my query in more clear way. I have a file having LRECL = 1000, Recfm=FB. There are 2 Date Fields (DATE1 & DATE2) in the file. I need to extract all records from file where DATE1 <= CURRENT DATE + 63 Days AND DATE2 >= CURRENT DATE. O/P file have attribute LRECL = 1000, Recfm=FB.

Thanks

Re: Date Range Selection Using SORT.

PostPosted: Sat Feb 07, 2015 1:42 am
by k singh
try to use include statement. some like this , give it a try and let us know for results
OUTFIL INCLUDE=(?,?,Y2T,GE,Y'DATE1',AND,?,?,Y2T,LE,Y'DATE1'-63)