Page 1 of 1

Variable length array

PostPosted: Sun Dec 26, 2010 6:51 pm
by Selvaraj
In cobol 85,owing to Cpu usage related performance,what is the main concern to know about Dynamic array(variable length array) while declaring multi dimensional array with DEPENDING ON clause? Quote important thing to know before coding this type of array?

Re: Variable length array

PostPosted: Sun Dec 26, 2010 7:06 pm
by Robert Sample
In cobol 85
Please relate this to a REAL compiler -- such as IBM Enterrprise COBOL, IBM COBOL for MVS & VM, IBM OS/390 COBOL, IBM VS COBOL II, IBM OS/VS COBOL -- since it is not possible for us to answer your question based upon a theoretical version of COBOL, only based upon a COBOL compiler version. If you want to know the answer to your question as stated, it is not hard to find the specifications for COBOL 85 and read them to see what is said. Since this would be a major waste of time for us, we will let you do the research.

With the IBM COBOL compilers, such as Enterprise COBOL, you should be aware that there is only a limited concept of dynamic arrays -- in WORKING-STORAGE, the entire maximum length of the array is allocated memory. So even though you use OCCURS DEPENDING ON in WORKING-STORAGE, practically there is no difference in memory used between an array defined with OCCURS and an array defined with OCCURS DEPENDING ON.

Re: Variable length array

PostPosted: Sun Dec 26, 2010 7:51 pm
by Selvaraj
Thanx robert for your quick reply.

Re: Variable length array

PostPosted: Mon Dec 27, 2010 10:24 am
by dick scherrer
Hello,

If CPU use is your main concern, what you should focus on is the code that uses these arrays and interacts with the database and/or extrenal files.