We are using the searching a table which is indexed, once
the key is found, how can we get the occurance at which the
key was found.
Answer / shobhit
Initialize the index and a variable to 1 before search.
SET IDX VAR-POS TO 1.
SEARCH TABLE VARYING VAR-POS
AT END DISPLAY "Not Found"
WHEN TABLE(IDX) = <SEARCH STRING>
MOVE VAR-POS TO RESULT-VAR
DISPLAY "FOUND AT POSITION" RESULT-VAR
END-SEARCH.
Now the position is available in the variable RESULT-VAR.
| Is This Answer Correct ? | 5 Yes | 0 No |
Suppose i want to declare a binary comp fild of 7 byte .how to write?
How will 128 be saved in s9 (3) comp-3 How will 12 be saved in s9 (2) comp
Which division and paragraphs are mandatory for a COBOL program?
.How to add one input & one Out file in existing cobol program. how approach tell me step by step.
I want ALL jcl ERROR cods
wht is the use of evalute verb ? how do u declare recfm in cobol and jcl ?
what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.
whats the disadvantage of search all over search?
What is the difference between working storage copybook and linkage section copybook?
What COBOL construct is the COBOL II EVALUATE meant to replace?
where do we use dyanamic call ? and where do we use static call pls give any example pls ?
if a pic 9(3) value 354,b pic x(2) value '46' then a)a>b 2)a<b 3)error