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 is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

1 Answers   Syntel,


I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?

3 Answers  


Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS

2 Answers  


How can you add a particular field in copybook?

2 Answers   L&T,


Explain complete concept of table handling in COBOL with an example?

2 Answers   IBM, TCS, Wipro,


How to remove 2 duplicate records and copy only one using job control language?

0 Answers  


Can we change the password using ALTER? anyone tried and changed?

0 Answers   IBM,


What type of Call you would use if you don;t want the control back to the calling program?

8 Answers   TCS,


If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


how to refer the data field?

0 Answers  


How do define dynamic array in cobol.

0 Answers  


what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?

2 Answers   IBM, Wipro,


Categories