Answer Posted / nagaraj
You can initialize an array in several ways based on the
values in the array.
If you know the values in the array already, then you can
do it through REDEFINE clause. I will give an example here.
05 MONTHS-VAL PIC X(36)
VALUE 'JanFebMarAprMayJunJulAugSepOctNovDec'.
05 MONTHS REDEFINE MONTHS-VAL PIC X(3)OCCURS 12 TIMES.
If you want to initialize at run time based on the user
input, then you can pass the values via ACCEPT statement
(online) /SYSIN DD statement (batch) and initialize the
COBOL array.
If you want to initialize with default values then you can
do it using INITIALIZE verb but be careful doing so.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What is length is cobol?
What is perform what is varying?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What is the difference between binary search and sequential search?
How arrays can be defined in COBOL?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
What is an in line perform? When would you use it? Anything else you wish to say about it.
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What are declaratives and what are their uses in cobol?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What guidelines should be followed to write a structured cobol prgm?
What is the difference between perform … with test after and perform … with test before?