View previous topic :: View next topic
|
Author |
Message |
sgupta9
New User
Joined: 16 Jul 2008 Posts: 12 Location: pune
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
sgupta9
New User
Joined: 16 Jul 2008 Posts: 12 Location: pune
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
sgupta9
New User
Joined: 16 Jul 2008 Posts: 12 Location: pune
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|