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

INCLUDE COND=


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

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Thu Sep 01, 2005 6:44 pm
Reply with quote



can any body let me know how below statement works!!

INCLUDE COND=(15,1,SS,EQ,C'ABC')
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Sep 01, 2005 6:50 pm
Reply with quote

This statement will not work or will work without the needed result.
To use the Substring Search you must define each include separately like this:
Code:
 INCLUDE COND=(15,1,SS,EQ,C'A,B,C')

SS = is the Sub-string Search.

Try to visit the manual:

Quote:
Suppose you want to select only the books for the Biology, History, Business and Psychology departments. Based on what you learned earlier, you can select those books using this INCLUDE statement:


INCLUDE COND=(106,5,CH,EQ,C'BIOL',OR,
106,5,CH,EQ,C'HIST',OR,
106,5,CH,EQ,C'BUSIN',OR,
106,5,CH,EQ,C'PSYCH')


But the more departments you want to include, the more typing you have to do. Instead, you can use one of the substring search capabilities of INCLUDE and OMIT to write the statement in a simpler form as:

INCLUDE COND=(106,5,SS,EQ,C'BIOL ,HIST ,BUSIN,PSYCH')


With substring search (SS format), you only write the field once and write the character constant so it includes all of the strings you want to search for. If the value in the field matches any of the strings (for example, "BUSIN"), the record is included. If the value in the field does not match any of the strings, the record is omitted.
The length of each string must match the length of the field. Because the Department field is 5 characters, you must add a blank at the end of "BIOL" and "HIST", which are each four characters, but not for "BUSIN" and "PSYCH", which are each five characters.

The other way to use substring search is by searching for a constant within a field. For example, if you wanted to select only the books with "INTRODUCTION" in their Title, you could use the following INCLUDE statement:


INCLUDE COND=(1,75,SS,EQ,C'INTRODUCTION')


The books selected for output would be:

COMPUTERS: AN INTRODUCTION
INTRODUCTION TO PSYCHOLOGY
INTRODUCTION TO BIOLOGY
Back to top
View user's profile Send private message
ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Thu Sep 01, 2005 8:25 pm
Reply with quote

Hi

Thanks alot!!
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: Thu Sep 01, 2005 9:07 pm
Reply with quote

Quote:
This statement will not work or will work without the needed result.


That's NOT true. In this case, C'ABC' is MORE correct then C'A,B,C'.

Code:

  INCLUDE COND=(15,1,SS,EQ,C'ABC')


will check for 'A' in 15, then 'B' in 15, then 'C' in 15.

Code:

  INCLUDE COND=(15,1,SS,EQ,C'A,B,C')


will check for 'A' in 15, then ',' (comma) in 15, then 'B' in 15, then ',' in 15, then 'C' in 15. So if there's a comma in 15, the record will be included which is probably NOT what's wanted. Of course, in most cases, there isn't a comma in 15, so using the comma as a separator does not cause a problem. But for a 1-byte field with SS, it's best NOT to use a separator between the elements.

For larger fields with SS, you normally want the separator to indicate which contiguous characters you're searching for. For example:

Code:

  INCLUDE COND=(15,2,SS,EQ,C'ABCDEF')


will look for 'AB' in 15-16, then 'BC' in 15-16, then 'CD' in 15-16, then 'DE', then 'EF' in 15-16. If you only want a "hit" on 'AB' or 'CD' or 'EF' and not on 'BC' or 'DE', then you need to use:

Code:

  INCLUDE COND=(15,2,SS,EQ,C'AB,CD,EF')


which will look for 'AB' in 15-16, then 'B,' in 15-16, then ',C' in 15-16, then 'CD' in 15-16, then 'D,' in 15-16, then ',E' in 15-16, then 'EF' in 15-16. Be sure to use a separator that will NOT be found (e.g. if 15-16 could contain ',E' but can't contain '-E', use C'AB-CD-EF').
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Sep 01, 2005 9:27 pm
Reply with quote

Ok, excuse me...
I don't tested it at the moment and I've only read the manual.
I must apologize to you.
Thank for your explanation.
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: Thu Sep 01, 2005 10:35 pm
Reply with quote

No apology necessary. Since the the separator character is generally needed, leaving it out for 1-byte fields is not actually covered in the doc, so I understand how you drew the conclusion you did. Of course, since I developed the code, I know how it actually works. icon_wink.gif
Back to top
View user's profile Send private message
ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Tue Sep 06, 2005 7:27 pm
Reply with quote

Hi

Thanks for ur information!!
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Reference for COND parameter. JCL & VSAM 1
No new posts IEF142I and Cond. Code 12 All Other Mainframe Topics 3
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
Search our Forums:

Back to Top