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

When the working storage variables get allocated? a.At Compile time b.At starting of the run time c.At end of the run time. d.None of these

6 Answers   Wipro,


Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?

3 Answers  


What happens in the background of spool when we submit a job for compilation and execution... This is a recent question in ibm...Kindly help me.....

3 Answers   IBM,


What is the difference between copy and include in cobol?

1 Answers  


Explain call by context by comparing it to other calls.

1 Answers  






What are the situations u have used in ur project for Subcript and Index ? 1.if u use Subscript why not Index,why u choose Subscript only? 2.if u use Index why not Subscript,what abt Displacement?

2 Answers   Cap Gemini,


1)what is the maximum limit for occurs? Eg: 01 A PIC X(10) OCCURS N TIME. What is the max value for N?

11 Answers   Wipro,


in a indexed file what is procedure for read the records from 12 to 18. please give the code example

2 Answers   L&T,


If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and will there be any error becoz of the Negative value

3 Answers   CTS,


Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above

7 Answers   TCS,


SUPPOSE I HAVE 60 CHARACTERS STING. IN THAT I WANT FIND OUT HOW MANY TIMES 'A'(ASSUME)WILL REPEATED AND I HAVE TO PASS 'E' IN PLACE OF 'A'ALONG THAT STRING.

2 Answers   Wipro,


what is the difference between implicit and explicit scope terminator with example? 

1 Answers  


Categories