How do define Dymanic array in cobol how do u define single
demensional arry and multidymensional arry in ur cobol.

Answers were Sorted based on User's Feedback



How do define Dymanic array in cobol how do u define single demensional arry and multidymensional ..

Answer / billyboyo

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.

Is This Answer Correct ?    4 Yes 1 No

How do define Dymanic array in cobol how do u define single demensional arry and multidymensional ..

Answer / mahesh

single dimensional array-
01 year grp.
05 month pic 9(2) occurs 12times.

multi dimensional array
01 year grp.
05 month occurs 12times.
05 weak occurs 4 times.
05 days pic x(4) occurs 7 times.

dynamic array-
01 yy grp.
05 month pic x(4) occurs 10-12 times depending upon 'yygrp'.

Is This Answer Correct ?    2 Yes 0 No

How do define Dymanic array in cobol how do u define single demensional arry and multidymensional ..

Answer / mr.perfect

dynamic array is used to accept the value based on the
random value

dynamic array-
01 yy grp.
05 month pic x(4) occurs 10 times depending upon IDX
IDX is variable name


01 idx pic x(1).

Is This Answer Correct ?    1 Yes 0 No

How do define Dymanic array in cobol how do u define single demensional arry and multidymensional ..

Answer / kalyan.p430

sorry i cant understand what is dynamic array?......pls
anyone explain to me

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

which is better comp or comp-3 in terms of memory utilization?

6 Answers  


what is record label is empty or standard in file description of data division?

2 Answers   HCL,


Differentiate COBOL and COBOL-II?

0 Answers  


What kind of error is trapped by on size error option?

0 Answers  


How do we get current date from system with century?

2 Answers  






What is the local-storage section?

0 Answers  


What is diff betn PS and ESDS file? What is the diffrent compiler options in cobol and there discription? What is retrive nth maximum salary from salary DB2 table. Can we redefine COM-3 variable with varchar variable?

4 Answers  


Describe the difference between subscripting and indexing ?

2 Answers  


if a file has 1000 recods how copy the records from 1 to 100 records using sort

4 Answers   IBM,


whats the disadvantage of search all over search?

4 Answers   Patni, TCS,


can we display comp-3 variables. if we want to display what we have to do . give me one example

6 Answers   CGI, Deloitte,


what is s013u000 for?

1 Answers   Hewitt,


Categories