i declare a Table as OCCURS 2000 TIMES.If the input file
has more than 2000 records will the COBOL program fail?
Answer Posted / prem
Occur clause is a kind of an array which holds the data of
simalar type in a particular record.
Ex: If we define an occur clause which hold the marks of a
particular student scored in 3 subjects. The code for this
would be as mentioned below
01 Student.
02 Name PIC X(20).
02 MARK OCCURS 3 times PIC 9(03).
So, For a Student "A" marks would be stored in MARK[1], MARK
[2], MARK[3], for "B" MARK[2], MARK[2], MARK[2] likes wise.
In a record format it would be displayed as below
A___________________052060080
B___________________060068070
Total length of the record is 20 + (3*3) = 29
This code will process n number of records no matter what
is the size of occur clause but if the length of the
records is beyond 29 then only the job will abend.
I hope this answers your query.
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What are the cobol coding sheets?
What kind of error is trapped by on size error option?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
How to print 10 to 1 if the input have only 10 digit number?
What is the difference between external and global variables in COBOL?
what happens if parmparameter passes zero bytes to the program
What is the problem of ordered sequential files access?
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 ......
What is the usage of comp fields in cobol?
How do you reference the following file formats from cobol programs?
IF I mention stop run in CICS what happens?
What is the difference between binary search and sequential search?
What are different data types in cobol?
What is a SSRANGE and NOSSRANGE?
What is static and dynamic call in cobol?