can u plz expain me how to declare dynamic array? what is
the meaning of depending on clause in dynamic array?

Answers were Sorted based on User's Feedback



can u plz expain me how to declare dynamic array? what is the meaning of depending on clause in dy..

Answer / amarnadh reddy

When a table of variable size is required, the occurs
depending clause may be used.

01 A1 PIC 99.
01 REC-1.
05 P1 PIC XX.
05 P2 PIC 99 OCCURS 1 TO 90 TIMES DEPENDING ON A1.

Here depending on the value of the data name A1 the size of
P2 Will be decided. It can be anything between 1 and 90.

Is This Answer Correct ?    31 Yes 4 No

can u plz expain me how to declare dynamic array? what is the meaning of depending on clause in dy..

Answer / roger riek

You can indeed create dynamic arrays in MVS Cobol. You need
to use the heap facility in the language environment.
There is a discussion about how to do this at
http://home.centurytel.net/rjriek/

Is This Answer Correct ?    0 Yes 1 No

can u plz expain me how to declare dynamic array? what is the meaning of depending on clause in dy..

Answer / kk

dynaic array is notink but a two dimension array.

01 studet.
02 stunam occurs 3 to 4 times depanding on n.
03 stuname pic x(15).
03 stumrk occurs 2 times.
04 stumark pic 9(3).
this is dynamic array.now runtime will pass the input.because
using depanding clause.

depanding clause pass the value runtime.

Is This Answer Correct ?    3 Yes 12 No

Post New Answer

More COBOL Interview Questions

I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.

2 Answers   L&T,


Can anyone please give the example of Inline Perform.

6 Answers   TCS,


can we print comp 3 stmts how ?

3 Answers   Accenture, TCS,


What is difference between comp & comp-4?

6 Answers  


What is the Purpose of POINTER Phrase in STRING command

3 Answers  






how to transfer the file from pc to mainframe??

4 Answers  


what is search and searchall?what is the diffrence between them?give an best example?

3 Answers   BirlaSoft,


How to read records which is in sequential file in reverse order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my doubt any one

10 Answers   IBM,


What is the difference between binary search and sequential search?

0 Answers  


What does the initialize statement do ?

2 Answers  


what is soc7 abend?how u can trace it?

4 Answers   Accenture,


what is internal sort and external sort ? which is preferable ?

2 Answers   TCS,


Categories