Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do u initialize an array?

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


Please Help Members By Posting Answers For Below Questions

What are the pertinent COBOL commands?

3102


Write the code to count the sum of n natural numbers.

1141


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

1098


) what is the difference between AID and HANDLE AID?

2099


Which Search verb is equivalent to PERFORM…VARYING?

999


What is the Purpose of POINTER Phrase in STRING command in COBOL?

1193


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

1041


What are the different types of condition in cobol and write their forms.

1064


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

3170


Difference between cobol and cobol-ii?

1192


Name the divisions, which are available in a cobol program?

1167


How do you reference the following file formats from cobol programs?

1119


Can you please let me know the centre name of INS certification in Kolkata.

2179


What are the access modes of START statement?

1186


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

1053