Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How memory allocation takes place for dynamic arrays

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
i_at_forum

New User


Joined: 29 Dec 2005
Posts: 10

PostPosted: Wed Jan 23, 2008 4:25 pm    Post subject: How memory allocation takes place for dynamic arrays
Reply with quote

Hi,
I have an array declaration as below.Can anyone explain me how memory allocation takes place for LOC? At run time will it occupy 99999 bytes independent of value in WS-MAX-LOC?

01 WS-TABLE.
05 LOC OCCURS 1 TO 99999 TIMES
DEPENDING ON WS-MAX-LOC.
10 WS-LOC PIC 9(01).



Pls help...
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jan 23, 2008 4:30 pm    Post subject:
Reply with quote

you are correct. there is no such thing as dynamic allocation of memory (you have to call a service routine to acquire memory outside of working-storage.) in cobol. The memory mapped at compile time is the size of working-storage. any internal cobol table will be assigned the max potential size. the odo is for processing efficiency. (i.e. SEARCHes are not conducted for items > the odo count.)
Back to top
View user's profile Send private message
i_at_forum

New User


Joined: 29 Dec 2005
Posts: 10

PostPosted: Wed Jan 23, 2008 5:12 pm    Post subject: Reply to: dynamic arrays
Reply with quote

thanks...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts Not enough virtual memory is availabl... Vinay Pushpala IBM Tools 16 Tue Sep 13, 2016 4:37 pm
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us