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

How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

5070


Write a cobol program making use of the redefine clause.

916


In COBOL programming, what is PERFORM? What is VARYING?

854


Can we change the password using ALTER? anyone tried and changed?

1733


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2584


Explain what you understand by passing by value.

898


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

2000


What is amode(24)?

867


Which is not true about evaluate statement

2081


How to print 10 to 1 if the input have only 10 digit number?

1016


What is the difference between Call and a Link?

874


What rules are followed by the search verb.

813


what are decleratives in cobol?

1985


Mention the guidelines to write a structured cobol program?

807


When is inspect verb is used in cobol?

902