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 |
how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it
Explain the configuration section of a cobol program with examples of syntax.
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
Write the code implementing the perform … varying.
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What is the default value of DISP for temp datasets
Where the Plan is located in CICS-DB2
What is difference between COBOL and VS COBOL II?.
) How do u handle errors in BMS macro
What are ISOLATION LEVELS? Where do we need to specify them?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
How many sections are there in data division?.