I have a sequential file. How do I access a record in this
sequential file randomly in my program ?
Answer Posted / harish
YS WE CANT ACCESS FLAT FILE RANDOMLY
IF WE WANT TO ACCESS PARTICULAR RECORD
PROCEDURE DIVISION.
MOVE KEYFIELD VALUE TO W-S VARIABLE
PERFORN UNTIL W-FLAG = 'Y'
READ FILE1 AT END MOVE 'Y' TO W-FLAG
NOT AT END
IF KEY-FILE1 = WS-KEY-VARIABLE
MOVE--------
ELSE
MOVE 'Y' TO W-FLAG.
pls correct me if anything wrong
HARISH POOMGAME SHIVAPPA(hassan,karnataka)
NIIT TECHNOLOGY
KOLKATA
| Is This Answer Correct ? | 0 Yes | 12 No |
Post New Answer View All Answers
What rules are followed by the search verb.
What is the difference between PIC 9.99 and PIC9v99?
) what is the difference between AID and HANDLE AID?
What is a SSRANGE and NOSSRANGE?
i need a small 3d program using inline and outline.
Write a program to enter and display the names of students in a class using the occurs clause.
what is amode(24), amode(31), rmode(24) and rmode(any)?
Which mode is used to operate the sequential file?
In COBOL programming, what is PERFORM? What is VARYING?
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.
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
Why did you choose to work with ibm mainframe cobol programming?
What are the different data types in cobol?
When is inspect verb is used in cobol?
What rules are to be followed while using the corresponding options?