Any way to pass the DATE to the SORT



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

Any way to pass the DATE to the SORT

Postby Irene Ioujanina » Tue Mar 22, 2011 1:58 am

Is there any way to pass the DATE to the SORT ?
I need to select the records with the yesterday's date.
Let's say, there is a huge file which includes the data for the whole year. Each record has a date like '2011-02-28' in the pos 1 thru 10. So to select the records for just one day (and it is always for yesterday's date) the SYSIN will look similar to
INCLUDE COND=(1,10,CH,EQ,C'2011-03-20')

Is any way to make '2011-03-20' be a result of the function, which let's say returns the todays date ?

Irene
Irene Ioujanina
 
Posts: 27
Joined: Thu Feb 21, 2008 6:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Any way to pass the DATE to the SORT

 

Re: Any way to pass the DATE to the SORT

Postby Frank Yaeger » Tue Mar 22, 2011 6:36 am

If you want today's date, you can use a DFSORT INCLUDE statement like this:

  INCLUDE COND=(1,10,CH,EQ,DATE1(-))


If you want yesterday's date, you can use a DFSORT INCLUDE statement like this:

  INCLUDE COND=(1,10,CH,EQ,DATE1(-)-1)


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Any way to pass the DATE to the SORT

Postby Irene Ioujanina » Thu Mar 24, 2011 7:23 pm

Thank you so much, Frank, for all your help!
I'm going to take a look at the tutorial.
Irene Ioujanina
 
Posts: 27
Joined: Thu Feb 21, 2008 6:42 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post