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

I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1221


Why did you choose to work with ibm mainframe cobol programming?

623


Explain about different table spaces.

641


How do get the result of your program directly on your pc?

1871


Which is not true about evaluate statement

1560






How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3706


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

666


When is inspect verb is used in cobol?

666


Difference between cobol and cobol-ii?

697


Which Search verb is equivalent to PERFORM…VARYING?

675


Define cobol?

854


How you can characterize tables in cobol?

707


What is the difference between binary search and sequential search?

633


how to move the records from file to array table. give with code example

2209


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1639