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 are the various section in data division and briefly explain them.
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
Difference between cobol and cobol-ii?
What is the utilization of copybook in cobol?
Write the code implementing the perform … varying.
A table has two indexes defined. Which one will be used by the SEARCH?
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
Which mode is used to operate the sequential file?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
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?
What is the use of intialize verb?
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
What are the pertinent COBOL commands?
Can a Search can be done on a table with or without Index?
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?