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 is a scope terminator give example?

1103


how do you reference the variable unblock file formats from cobol programs

1321


How do define dynamic array in cobol.

1122


What is the difference between next sentence and continue in cobol programing language?

1214


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

2005


Can we change the password using ALTER? anyone tried and changed?

2006


how do you reference the variable block file formats from cobol programs

1241


What kind of error is trapped by on size error option?

1224


What is the difference between PIC 9.99 and PIC9v99?

1332


What is the difference between PIC 9.99 and 9v99 in COBOL?

1325


What is the difference between Global and External Variables?

1369


Why occurs cannot be used in 01 level in COBOL?

1154


what is amode(24), amode(31), rmode(24) and rmode(any)?

1136


How to know whether the module is dynamical or statistical?

1130


i want a program using by if, evaluate , string, unstring, perform, occurs?

4714