i declare a Table as OCCURS 2000 TIMES.If the input file
has more than 2000 records will the COBOL program fail?

Answer Posted / giri

Veena, as far as I knw, An OCCURS clause is used to
indicate the repeated occurrences of items of the same
format in a structure. It is nothing to do with the number
of records in the file. As per your question the filed
which you declare in the table occurs 2000 times. And this
is not the number of record. So your program will read all
the records in the input file. You can display any
occurance of the field like FIELD-NAME(1998) will result in
the value stored in that position, i mean to say 1998th
occurance. When you try to read beyond 2000,the program
will abend with SOC4. I hope I have cleared your doubt!

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is inspect in cobol ?

791


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

704


How do you differentiate between cobol and cobol-ii?

646


Which division and paragraphs are mandatory for a COBOL program?

703


Explain how you can characterize tables in cobol?

634






Write the code implementing the perform … varying.

635


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

724


Which is not true about evaluate statement

1560


Define cobol?

854


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

1947


What is perform what is varying?

695


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1915


What guidelines should be followed to write a structured cobol prgm?

662


What is a scope terminator give example?

650


Define static linking and dynamic linking.

654