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

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.

4200


What are the rules of the move verb?

1318


how do you reference the ksds vsam file formats from cobol programs

1237


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

1369


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?

1246


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3313


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

1174


Whats the difference between search & search ALL?

6636


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2470


How do we get current date from system with century in COBOL?

1423


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5790


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

1205


How to know whether the module is dynamical or statistical?

1199


What is static and dynamic call in cobol?

1111


What is rmode(24)

1192