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
 

 

Consolidating WHEN condition for SEARCH ALL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Consolidating WHEN condition for SEARCH ALL
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: 7931
Location: Bellevue, IA

PostPosted: Thu Jul 24, 2008 7:11 pm    Post subject:
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    Post subject: Reply to: Consolidating WHEN condition for SEARCH ALL
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: 743
Location: Germany

PostPosted: Thu Jul 24, 2008 7:27 pm    Post subject:
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    Post subject: Reply to: Consolidating WHEN condition for SEARCH ALL
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: 7931
Location: Bellevue, IA

PostPosted: Thu Jul 24, 2008 7:41 pm    Post subject:
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: 743
Location: Germany

PostPosted: Thu Jul 24, 2008 7:54 pm    Post subject:
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: 7931
Location: Bellevue, IA

PostPosted: Thu Jul 24, 2008 8:04 pm    Post subject:
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: 743
Location: Germany

PostPosted: Thu Jul 24, 2008 8:15 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jul 24, 2008 9:23 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts Consolidating and summing file contents Kevin Lindsley SYNCSORT 14 Thu Jun 09, 2016 5:24 am
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am


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