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

Consolidating WHEN condition for SEARCH ALL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sgupta9

New User


Joined: 16 Jul 2008
Posts: 12
Location: pune

PostPosted: Thu Jul 24, 2008 6:53 pm
Reply with quote

I have the following problem.

I am searching a table using SEARCH ALL and need to combine the when conditions in bold

SEARCH ALL BBK-SURCHG-TABLE
AT END
reset the switch

WHEN FIELD1 (BBKSC-INDX) =
VALUE1
set the switch

WHEN FIELD1(BBKSC-INDX) = ZEROES
NEXT SENTENCE.


Could you please give me some guidance for this
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 24, 2008 7:11 pm
Reply with quote

Have you read the manual? The syntax diagram for the WHEN clause indicates only AND conditions are allowed; it does not appear that you can do what you want in COBOL.
Back to top
View user's profile Send private message
sgupta9

New User


Joined: 16 Jul 2008
Posts: 12
Location: pune

PostPosted: Thu Jul 24, 2008 7:26 pm
Reply with quote

by mistake i wrote SEARCH ALL it is only SEARCH

Write now the syntax is SEARCH and i want to consolidate the 2 when statements to use it for SEARCH ALL syntax
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Jul 24, 2008 7:27 pm
Reply with quote

Hi sgupta9

Why do you need this combination.
The Switch is set or not, depending on Field1 = Value1

In fact of restrictions of SEARCH-Command you could use IF ore EVALUATE or whatever after the search to test whatever you want.

Or you could programm your own little Loop and using EVALUATE with two conditions. Evaluate Field1 also Field2.
Back to top
View user's profile Send private message
sgupta9

New User


Joined: 16 Jul 2008
Posts: 12
Location: pune

PostPosted: Thu Jul 24, 2008 7:31 pm
Reply with quote

but my requirement is to use SEARCH ALL only and not perform.

I am not getting how to combine the 2 conditions for that
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 24, 2008 7:41 pm
Reply with quote

In a SEARCH ALL statement, you are only allowed to use the AND conditions. value1 AND spaces will result in you never selecting the WHEN clause, which I doubt you want. So, to reiterate my previous statement, what you are wanting to do in a SEARCH ALL statement cannot be done in COBOL.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Jul 24, 2008 7:54 pm
Reply with quote

Hi Robert !

Don't get upset. It's no use.
Some will never accept the words of advice of a wise man.

Have a good time,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 24, 2008 8:04 pm
Reply with quote

UmeySan, I'm not upset (yet) .... although this forum does seriously lack some required items such as <baseball bat> to get people's attention, and a "What part of "NO" don't you understand?" button. The bold is to hopefully get the OP to actually read the text!
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Jul 24, 2008 8:15 pm
Reply with quote

Robert, our brother-in-arms, dbzTHEdinosauer, got the right avatar, i think.

So for me, I'm chucking it in right now. Have a good one!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 9:23 pm
Reply with quote

Hello,

Quote:
but my requirement is to use SEARCH ALL only and not perform.
I believe this is nonsense. . . It is surely not a business requirement.

Who/what dictated this? Unless they have the power to get the COBOL language changed (and very quickly), i suggest you implement code that will currently work (with no language enhancement) to meet the actual business requirement (i.e. the reason that code is being written in the first place).
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top