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


Please Help Members By Posting Answers For Below Questions

please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1949


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

697


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.

3713


Mention the guidelines to write a structured cobol program?

614


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

2656






Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

816


How do u write test cases?

1633


How to know whether the module is dynamical or statistical?

650


How are the next sentence and continue different from each other?

760


How you can read the file from bottom?

657


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1764


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

892


A table has two indexes defined. Which one will be used by the SEARCH?

752


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

624


What is the Purpose of Pointer in the string?

639