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
 

 

INCLUDE COND=

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: INCLUDE COND=
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    Post subject:
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    Post subject:
Reply with quote

Hi

Thanks alot!!
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: Thu Sep 01, 2005 9:07 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Sep 01, 2005 10:35 pm    Post subject:
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    Post subject: Re: DFSORT - INCLUDE COND=(15,1,SS,EQ,C'ABC')
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    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 Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm


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