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 report-item in COBOL?
explain sorting techniques in cobol program?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
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
What are the pertinent COBOL commands?
Are you comfortable in cobol or jcl?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
how to convert the recors form vsam file to db2 table tru file aid
What is a SSRANGE and NOSSRANGE?
Difference between cobol and cobol-ii?
what is the use of outrecord?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What is the difference between external and global variables in COBOL?
What is redefines clause in COBOL?
Can we redefine the field of x(200) to less than 200?