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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2544


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5670


What is the difference between PIC 9.99 and 9v99 in COBOL?

1244


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

9018


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

1033


What are different data types in cobol?

1227


How arrays can be defined in COBOL?

1135


In COBOL programming, what is PERFORM? What is VARYING?

1087


How you can characterize tables in cobol?

1148


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

1199


Name the sections present in data division.

1175


What is the difference between perform … with test after and perform … with test before?

1371


What is difference between static and dynamic call in cobol?

1301


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

2060


What kind of error is trapped by on size error option?

1176