Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Spool Extract for Z /os 1.04 version Khadhar Basha CLIST & REXX 3 Thu Sep 28, 2017 3:14 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us