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
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
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.
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Which is not true about evaluate statement
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
Can we change the password using ALTER? anyone tried and changed?
How do you get the data to code the BMS macro?
What is redefines clause in COBOL?
) what is the difference between AID and HANDLE AID?
What is a SSRANGE and NOSSRANGE?
i want a program using by if, evaluate , string, unstring, perform, occurs?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
For rewrite, why is it mandatory that file needs to be opened?
What is the difference between next sentence and continue in cobol programing language?
) How do u handle errors in BMS macro