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

How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length

2 Answers   IBM, Wipro,


What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. 05 MM PIC 99. 05 YY PIC 99. (a) Nothing is wrong. (b) Under W-DATE all level 05 items are having a PIC 99 but level 01 has PIC X(6). (c) PIC can't be specified for a group item. (d) DD, MM, and YY are invalid datanames.

6 Answers   Mphasis, TCS,


how to refer the data field?

0 Answers  


Which of the following EDITind and PICTURE symbols is to be used if a minus(-) is to appear before the value if the value is -ve and a plus(+) is to appear before the value if the value is +ve? (a) + (b) - (c) + OR (d) It is not possible

7 Answers   TCS,


What is Control Break processing ?

1 Answers   iGate,






01 a pic 9(9v99) 01 b pic 9(9.99) wht will be the stored vales in both cases

6 Answers   Patni,


give the examples for strings and unstrings in cobol

2 Answers   IBM,


88 class is used for

5 Answers   CTS, EDS,


What are the access modes of START statement?

0 Answers  


How do you code Cobol to access a parameter that has been defined in JCL?

3 Answers  


How can I find the maximum value of a field in a file while reading the file dynamically? without using sort function. Suppose i have a file with fields Timestamp, description, teamname, teamnumber.. i have read the file till end and find the maximun value of timestamp which is not in sorted order.. can we use function max(timestamp)?

1 Answers   CGI,


How do you define a variable of COMP-1? COMP-2?

3 Answers  


Categories