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
 

 

Extract records within a date range

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Fri May 11, 2007 7:11 am    Post subject: Extract records within a date range
Reply with quote

Hi,

I need to extract records from a file within a date range Oct 1 2006 and Dec 31 2006.
The position of the Date field is 36 position and its length is 8 chars (CCYYMMDD). I need to do it with sort.
Can anyone help me out with this.

Regards
Sandhya
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri May 11, 2007 12:26 pm    Post subject:
Reply with quote

WHich SORT, DFSORT or SYNCSORT ?

Use the INCLUDE statement

Code:

  INCLUDE COND=(pos,len,format,operator,value)
Back to top
View user's profile Send private message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Fri May 11, 2007 12:50 pm    Post subject: Re: Extract records within a date range
Reply with quote

Hi expat,

I was aware of the above mentioned format for DFSORT, but was skeptical whether the GE would work for the Date fields.

I have the solution

Code:

  INCLUDE COND=(34,8,CH,GE,C'20070224')


Regards
Sandhya
Back to top
View user's profile Send private message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Fri May 11, 2007 12:51 pm    Post subject: Re: Extract records within a date range
Reply with quote

Thank you for the reply Expat
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri May 11, 2007 12:54 pm    Post subject:
Reply with quote

No problems. And thank you for posting your solution. It may help others with the same question easily find the solution they want.
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: Fri May 11, 2007 8:32 pm    Post subject:
Reply with quote

Quote:
I need to extract records from a file within a date range Oct 1 2006 and Dec 31 2006. The position of the Date field is 36 position and its
length is 8 chars (CCYYMMDD).


The INCLUDE statement you show does not match what you said. This DFSORT INCLUDE statement does:

Code:

  INCLUDE COND=(36,8,CH,GE,C'20061001',AND,
     36,8,CH,LE,C'20061231')
Back to top
View user's profile Send private message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Tue May 15, 2007 2:17 pm    Post subject: Re: Extract records within a date range
Reply with quote

Hi Frank,

What you have specified is the correct answer to my question.

The reply that I had given was for the final version of my requirement. As you already would know - requirements change sometimes.

The final requirement is :
Extract all records with date greater than or equal to 24 Feb 2007.
Date position is 34 and CCYYMMDD format.
My post above has the reply for the same.


Sorry to have mislead.
Thanks Frank for correcting.

Regards
Sandhya
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