Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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.



We are using the searching a table which is indexed, once the key is found, how can we get the occ..

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

Post New Answer

More COBOL Interview Questions

Suppose i want to declare a binary comp fild of 7 byte .how to write?

6 Answers   IBM,


How will 128 be saved in s9 (3) comp-3 How will 12 be saved in s9 (2) comp

3 Answers   CTS,


Which division and paragraphs are mandatory for a COBOL program?

0 Answers  


.How to add one input & one Out file in existing cobol program. how approach tell me step by step.

2 Answers   Syntel,


I want ALL jcl ERROR cods

1 Answers  


wht is the use of evalute verb ? how do u declare recfm in cobol and jcl ?

2 Answers   EDS,


what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.

3 Answers   HCL, TCS,


whats the disadvantage of search all over search?

4 Answers   Patni, TCS,


What is the difference between working storage copybook and linkage section copybook?

5 Answers   TCS,


What COBOL construct is the COBOL II EVALUATE meant to replace?

1 Answers  


where do we use dyanamic call ? and where do we use static call pls give any example pls ?

3 Answers   Patni,


if a pic 9(3) value 354,b pic x(2) value '46' then a)a>b 2)a<b 3)error

8 Answers   Cap Gemini,


Categories