How to define a array dynamically.....
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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
Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?
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.....
What is the difference between copy and include in cobol?
Explain call by context by comparing it to other calls.
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?
1)what is the maximum limit for occurs? Eg: 01 A PIC X(10) OCCURS N TIME. What is the max value for N?
in a indexed file what is procedure for read the records from 12 to 18. please give the code example
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
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
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.
what is the difference between implicit and explicit scope terminator with example?