How to define a array dynamically.....

Answers were Sorted based on User's Feedback



How to define a array dynamically.......

Answer / samay simant

Use the Occurs Depending on clause.

01 College-table
05 Student-table occurs 10 to 20 times depending on
NUM_Stud.

Here the size of array is dependent on Number of students.
Thus this is dynamically created.

Is This Answer Correct ?    5 Yes 1 No

How to define a array dynamically.......

Answer / billyboyo

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.

Is This Answer Correct ?    2 Yes 0 No

How to define a array dynamically.......

Answer / mahesh

hi pandu
occurs clause is used to define the tables so in
01 we mention the group so it does not any pic clause
even sub groups are also not having a pic clause
only elementary items contain pic clause

Is This Answer Correct ?    1 Yes 0 No

How to define a array dynamically.......

Answer / pandu

hi Samay,your answer is correct but i had doubt why don't
we write it as
01 College-table
05 Student-table occurs 10 to 20 times depending on
NUM_Stud.
because 01-49 all are group items naa.
and why don't we mention pic clause in above 01 and 05

pls tell me naa.

Is This Answer Correct ?    0 Yes 0 No

How to define a array dynamically.......

Answer / mehak

use
ocuurs 1 to 100
depending on ws-counter

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

What should be the sorting order for SEARCH ALL?

5 Answers  


where do we use dyanamic call ? and where do we use static call pls give any example pls ?

3 Answers   Patni,


example for sub strings ? and refernce modifications whit output pls

0 Answers   College School Exams Tests, IBM,


Can a Search can be done on a table with or without Index?

0 Answers  


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

0 Answers  






01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?

3 Answers   Patni,


Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?

1 Answers  


what is the difference between start and startbr?

2 Answers  


How do you define a table/array in COBOL?

5 Answers   Hexaware,


which certifications r 4 cobol,jcl,db2,cics what is format of xam n what is importance of these certifications... plz post answer only if u r sure... thanks

1 Answers  


I have a Flat file in which certain records are present in a tabular format. I need to extract some of the records on some basis from it and copy them into a flat file...how it can be done ??

2 Answers   HCL,


How to code fscode 10 in cobol program? Where yoy code in your pgm?give ans for the question.

2 Answers   IBM,


Categories