I need to Search the Table. Say the Table is like below
P S R
1 2 3
2 3 4
3 4 5
4 5 6
SET IDX TO +1
AT END GO TO PARA-EXIT
WHEN P(IDX) = 1 AND S(IDX) = 2
MOVE R(IDX) TO SOME-VARIABLE
How to search the next three elements
Can I code multiple WHEN conditions.Please suggest.sine Index set to +1 it will search the first element.(but Index increment will be taken care by SEARCH) If set the index up by +1 then it will go to next element.but how to code SEARCH
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
Can I code multiple WHEN conditions.Please suggest
There is a link to manuals at the top of this page. I suggest you click on it, find the COBOL Language Reference manual, find the SEARCH section, and find out yourself.
The way you've described it, this sounds like a homework exercise more than a real-world need -- and it sounds like an artificial way to invoke the SEARCH verb, at that. Multiple IF statements would handle what you've said you wanted to do without needing any SEARCH statement.