How to read a 100 record from a file through cobol?
Answer Posted / y@$w@nth
I. I think ur asking how to read 100th record????
here is the syntax
a. MOVE 100 to rec-key
READ in-file KEY IS rec-key
END-READ.
In the above we followed random reading from a VSAM(KSDS) File
b.For sequential file if u need to read 100Th record then we
need to write a perform statement that will run 100 times
then read statement will execute 100 times then after
termination of perform statement we will have 100th record.
II.If ur asking about u need to read 100 records and store
them in a place go and read the all 100 records and store
each record in a table(array).
Let me know if any other...
Y@$W@nth...
Cheers....
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
Name the sections present in data division.
What is a scope terminator give example?
What are the different data types in cobol?
What are the pertinent COBOL commands?
how do you reference the esds vsam file formats from cobol programs
When is inspect verb is used in cobol?
Write the code implementing the perform … varying.
What is redefines clause in COBOL?
What are different data types in cobol?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
How arrays can be defined in COBOL?
What is a SSRANGE and NOSSRANGE?
What are literals?
For rewrite, why is it mandatory that file needs to be opened?