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

System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

2027


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

2402


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2334


Which is not true about evaluate statement

2405


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1469


Can we change the password using ALTER? anyone tried and changed?

1964


How do you get the data to code the BMS macro?

1932


What is redefines clause in COBOL?

1257


) what is the difference between AID and HANDLE AID?

2110


What is a SSRANGE and NOSSRANGE?

1421


i want a program using by if, evaluate , string, unstring, perform, occurs?

4649


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17812


For rewrite, why is it mandatory that file needs to be opened?

1075


What is the difference between next sentence and continue in cobol programing language?

1173


) How do u handle errors in BMS macro

1972