Answers

Question and Answer:

  Home  IBM MainFrame

⟩ How do define Dynamic array in COBOL how do u define single dimensional array and multidimensional array in your COBOL?

In IBM Cobol

1) In IBM's Language Environment you can dynamically

acquire storage (look up HEAP in the manual). The storage

you acquire you can use as you like. Can be an array,

therefore a dynamic array. It is a "work-around" as dynamic

arrays are not directly supported.

2) 01 SINGLE-DIM-ARRAY

05 SDA-ITEM PIC X OCCURS 30.

A single-dimension array of thirty one-byte characters.

3) 01 MULTI-DIM-ARRAY.

05 MDA-FIRST-DIM OCCURS 20.

07 MDA-SECOND-DIM OCCURS 30 PIC X.

A multi-dimension array of 20 times 30 one-byte characters.

 204 views

More Questions for you: