Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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 - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us