How do define Dymanic array in cobol how do u define single
demensional arry and multidymensional arry in ur cobol.
Answers were Sorted based on User's Feedback
Answer / billyboyo
In IBM Cobol
1) 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.
2) 01 SINGLE-DIM-ARRAY
05 SDA-ITEM PIC X OCCURS 30.
A single-dimension array of thirty one-byte characters.
3) 01 MULTI-DIM-ARRAY.
05 MDA-FIRST-DIM OCCURS 20.
07 MDA-SECOND-DIM OCCURS 30 PIC X.
A multi-dimension array of 20 times 30 one-byte characters.
| Is This Answer Correct ? | 4 Yes | 1 No |
single dimensional array-
01 year grp.
05 month pic 9(2) occurs 12times.
multi dimensional array
01 year grp.
05 month occurs 12times.
05 weak occurs 4 times.
05 days pic x(4) occurs 7 times.
dynamic array-
01 yy grp.
05 month pic x(4) occurs 10-12 times depending upon 'yygrp'.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / mr.perfect
dynamic array is used to accept the value based on the
random value
dynamic array-
01 yy grp.
05 month pic x(4) occurs 10 times depending upon IDX
IDX is variable name
01 idx pic x(1).
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / kalyan.p430
sorry i cant understand what is dynamic array?......pls
anyone explain to me
| Is This Answer Correct ? | 0 Yes | 0 No |
can we use reference modification an arry.
can anyone explain me the concept of COMP-4 PLEASE??
How do you code Cobol to access a parameter that has been defined in JCL?
How do pass the values to the parameters in cobol
I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?
why do u need inspect verb?
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
I have a sequential file of 100 records. How do I load the records into a two dimensional array ?
How do u initialize an array?
have in 100 records in a file i want to move only matched records to one output_file1 and nonmathed records are moved to another output_file2 ... any one can provide logic code
Hai friends why we need to read a file before re-write a record?
can we declare s9(9)v9(9) in cobol ? if yes how many bytes it will occupy ?(urgent plz answer it)