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


Please Help Members By Posting Answers For Below Questions

What is report-item in COBOL?

894


explain sorting techniques in cobol program?

887


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

2114


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

2358


What are the pertinent COBOL commands?

2824


Are you comfortable in cobol or jcl?

805


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

905


how to convert the recors form vsam file to db2 table tru file aid

2979


What is a SSRANGE and NOSSRANGE?

1107


Difference between cobol and cobol-ii?

940


what is the use of outrecord?

1968


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

878


What is the difference between external and global variables in COBOL?

1039


What is redefines clause in COBOL?

1035


Can we redefine the field of x(200) to less than 200?

1091