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 is link edit in cobol?
What is the LINKAGE SECTION used in COBOL?
Write a cobol program making use of the redefine clause.
What is a SSRANGE and NOSSRANGE?
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
What rules are to be followed while using the corresponding options?
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
What are the pertinent COBOL commands?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
i want a program using by if, evaluate , string, unstring, perform, occurs?
how do you reference the ksds vsam file formats from cobol programs
What is a report item?
What is the difference between goback, stop run and exit program in cobol?
Discuss about changing dataset name in proc.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?