IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Retrieve Records Within date range


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
spamidighantam

New User


Joined: 30 Aug 2006
Posts: 8

PostPosted: Tue Nov 28, 2006 1:31 pm
Reply with quote

I would like to retrieve the records within a particular date range.

I think the control card should look like this:

For example,

the flat file contains date in 52nd position like 2006-11-21. I would like to retrieve records between 2006-10-01 and 2006-11-31.

INCLUDE COND = (52,10,CH,GE,DATE1(-)'2006-10-01', OR,
52,10,CH,LE,DATE1(-)'2006-11-31')

But this is not working.

Sreedhar
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Tue Nov 28, 2006 3:11 pm
Reply with quote

Hi,
Try this
Code:

INCLUDE COND=(52,10,CH,GT,C'2006-10-01',AND,52,10,CH,LT,C'2006-11-31')
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 28, 2006 9:31 pm
Reply with quote

Sreedhar,

Here's a DFSORT job that will do what you asked for. I assumed you wanted to include records between 2006-10-01 and 2006-11-31 inclusive.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(52,10,CH,GE,C'2006-10-01',AND,
    52,10,CH,LE,C'2006-11-31')
/*


Note: You can't just make up your own syntax for DFSORT and expect it to work. You have to look up the actual syntax to use. 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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
spamidighantam

New User


Joined: 30 Aug 2006
Posts: 8

PostPosted: Wed Nov 29, 2006 6:16 am
Reply with quote

Thank you so much ...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top