Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Retrieve Records Within date range

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Retrieve Records Within date range
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    Post subject: Re: Retrieve Records Within date range
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 Moderator


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

PostPosted: Tue Nov 28, 2006 9:31 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject: Re: Retrieve Records Within date range
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us