Date Range Selection Using SORT.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Date Range Selection Using SORT.

Postby Vineet » Thu Feb 05, 2015 7:42 pm

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
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Date Range Selection Using SORT.

 

Re: Date Range Selection Using SORT.

Postby BillyBoyo » Thu Feb 05, 2015 7:57 pm

So have a look at INCLUDE COND= and see where you get with that.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Date Range Selection Using SORT.

Postby Vineet » Fri Feb 06, 2015 4:40 am

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
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Date Range Selection Using SORT.

Postby k singh » Sat Feb 07, 2015 1:42 am

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)
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post