OCCURS clause cannot be used in 01 Level

  1. Occurs clause in 01 cant be done because 01 is the top most level.

  2. Who said so, you can use it, I bet!

  3. Occurs clause is there to repeat fields with same format, not the records.

  4. Stack will over flow.


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of the OCCURS clause in COBOL.

The OCCURS clause is used to define a table or array in COBOL. It specifies the number of occurrences of a field or group of fields within the table or array. The OCCURS clause can only be used with elementary data items (such as numeric or alphanumeric fields) and cannot be used with group items or record descriptions.

Option A) Occurs clause in 01 can't be done because 01 is the topmost level - This option is incorrect because the OCCURS clause can be used with elementary data items at the 01 level or any other level within the record description.

Option B) Who said so, you can use it, I bet! - This option is incorrect because it does not provide any explanation or reasoning.

Option C) Occurs clause is there to repeat fields with the same format, not the records - This option is correct. The OCCURS clause is used to repeat fields with the same format within a table or array. It does not repeat entire records.

Option D) Stack will overflow - This option is incorrect because it does not relate to the use of the OCCURS clause in COBOL.

The correct answer is C) Occurs clause is there to repeat fields with the same format, not the records. This option is correct because it accurately explains the purpose and usage of the OCCURS clause in COBOL.

Find more quizzes: