Variable length array



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Variable length array

Postby Selvaraj » Sun Dec 26, 2010 6:51 pm

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?
Selvaraj
 
Posts: 9
Joined: Wed Dec 22, 2010 9:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable length array

 

Re: Variable length array

Postby Robert Sample » Sun Dec 26, 2010 7:06 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Variable length array

Postby Selvaraj » Sun Dec 26, 2010 7:51 pm

Thanx robert for your quick reply.
Selvaraj
 
Posts: 9
Joined: Wed Dec 22, 2010 9:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable length array

Postby dick scherrer » Mon Dec 27, 2010 10:24 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post