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

Extract records within a date range


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Fri May 11, 2007 12:26 pm
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
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
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: 8797
Location: Welsh Wales

PostPosted: Fri May 11, 2007 12:54 pm
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 Developer


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

PostPosted: Fri May 11, 2007 8:32 pm
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
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 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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top