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
What is the LINKAGE SECTION used in COBOL?
How arrays can be defined in COBOL?
How to remove 2 duplicate records and copy only one using job control language?
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?
How do you define a variable of comp-1 and comp-2?
how to refer the data field?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What is a scope terminator give example?
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What is static and dynamic call in cobol?
Write down the divisions of cobol program?
What are the different data types in cobol?
What rules are followed by the search verb.