How do u initialize an array?
Answers were Sorted based on User's Feedback
array can be initiazed by INITIALIZE verb or by moving the
values to the elements of a table.
if u initialise an array with INITIALIZE verb your
alphanumeric fields will be stored with space and numeric
fields with '0'.
| Is This Answer Correct ? | 9 Yes | 3 No |
Answer / 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 |
Write a program to concert an Indexed file into Sequential file?
i have variable record in the 5th, i want to sort from 5th filed ? how ?
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
In CICS/VSAM every file that is accessed should be defined in FCT. we have CICS READ, WRITE, BROWSE commands for VSAM files. How does it work with DB2 tables. It know it has to do with the plan. Please expain with examples.
)what is retrieve?
how many bytes does a s9(12)COMP-4 field occupy?? a.2 b.4 c.8 d.1 ans with reason please
How do you code Cobol to access a parameter that has been defined in JCL?
wht is packed decimal in cobol
What are the access modes of START statement?
can we use go to statement inline-perform?
how will u code parm parameter and where pls ?
What is R-mode and A-mode?