why we are not using multiple when conditions in search all



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

why we are not using multiple when conditions in search all

Postby slaxman9 » Wed Oct 31, 2012 9:16 am

Any one help me for this ....

Why we are not using multiple when conditions in searchall...
slaxman9
 
Posts: 6
Joined: Mon Jul 11, 2011 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: why we are not using multiple when conditions in search all

 

Re: why we are not using multiple when conditions in search

Postby Pandora-Box » Wed Oct 31, 2012 11:47 am

multiple when conditions


What do you mean by that?
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: why we are not using multiple when conditions in search

Postby Monitor » Wed Oct 31, 2012 12:01 pm

Its difficult to understand your question.
Search All (Binary Search) can only specify one condition related to the key, and nothing but the key. Thats the idea with binary search.
If you want to specify "multiple" conditions, you can use sequential Search (remove the All keyword).
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: why we are not using multiple when conditions in search

Postby BillyBoyo » Wed Oct 31, 2012 2:47 pm

SEARCH ALL will discover whether an item exists in the table, or it does not. Since there are only two possible outcomes, which are mutually exclusive, and can already be identified as seperate, there is no opportunity for multiple condition statements.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: why we are not using multiple when conditions in search

Postby Robert Sample » Wed Oct 31, 2012 5:44 pm

There is a link to IBM Manuals at the top of the page. If you click on it, then click on the Enterprise COBOL Language Reference manual, you can find the syntax diagram for the SEARCH ALL statement in section 6.2.32 and it explicitly allows a WHEN condition to use AND, so even though you can only use one WHEN statement that statement can be a compound condition.
Robert Sample
Global moderator
 
Posts: 3460
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 244 times

Re: why we are not using multiple when conditions in search

Postby slaxman9 » Wed Oct 31, 2012 9:56 pm

Thanks to all....
slaxman9
 
Posts: 6
Joined: Mon Jul 11, 2011 4:17 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post