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 are differences between COBOL and java ? why we are giving more preference to COBOL ?

3 Answers   TCS,


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


Wat is the difference between NEXT and CONTINUE statement in cobol,can any one explain with example.

11 Answers   Deloitte,


hi. This is Ram.i have one doubt.why can't we display comp-3 variables directly? let me answer quickly plez........

1 Answers  


With in these three which one is the default one Call Reference, Call By Value, Call By Content.-Which one is default?

4 Answers   IBM,






What are literals?

0 Answers  


Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.

12 Answers  


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


In a file if a column account number conatain value 0001234.. how can we move the value to another variable without zero. value may contain any type such as 00123405. we need the value 1234 or 12305. how can we do that in cobol. Please help.

1 Answers   CSC,


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

6 Answers   CGI, Deloitte,


I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?

1 Answers  


If we use GO BACK instead of STOP RUN in cobol?

2 Answers   Temenos,


Categories