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
 
Local-Storage Section in IBM COBOL

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

New User


Joined: 23 Feb 2007
Posts: 3
Location: S?o Paulo - Brazil

PostPosted: Fri Mar 30, 2007 11:07 pm    Post subject: Local-Storage Section in IBM COBOL
Reply with quote

Hi,

When I was studying IBM's manuals I saw Local-Storage Section but I didn't understand it.

Somebody could explain this.

And why should I use the Parameter Global in declaration variable?!

Thanks!
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Mar 31, 2007 12:31 am    Post subject:
Reply with quote

Hello,

Unless/until you start building multi-thread code you won't need to use local-storage. Following is a bit from IBM:
Quote:
Choosing LOCAL-STORAGE or WORKING-STORAGE: Because you must code your multithreaded programs as recursive, the persistence of data is that of any recursive program:

Data items in the LOCAL-STORAGE SECTION are automatically allocated for each instance of a program invocation. When a program runs in multiple threads simultaneously, each invocation has a separate copy of LOCAL-STORAGE data.
Data items in the WORKING-STORAGE SECTION are allocated once for each program and are thus available in their last-used state to all invocations of the program.
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Mon Apr 02, 2007 6:28 pm    Post subject:
Reply with quote

If your program is recursive, then you need LOCAL STORAGE. Recursive programs are not only required for multi-threading. We have 2 programs that need to be RECURSIVE and they both use LOCAL STORAGE.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 02, 2007 8:13 pm    Post subject:
Reply with quote

Thanks for the clarification icon_smile.gif
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Sat Apr 07, 2007 5:17 am    Post subject:
Reply with quote

One more thing about LOCAL-STORAGE that I just discovered this week.

WORKING-STORAGE gets allocated from the HEAP, whereas LOCAL-STORAGE gets allocated from the STACK.

In our batch environment the STACK is configured to obtain its memory from below the line. HEAP draws from above the line.

(In CICS, both the HEAP and STACK get allocated from above the line. No problem there...)

We have a batch job that is abending because it is running out of memory below the line. We have been chasing this problem for 2 weeks - pulling our hair out.

It turns out that the 2 RECURSIVE program I mentioned early, both of which use LOCAL-STORAGE are major contributors to this problem. We also discovered that many programs had been mistakenly compiled using the DATA(24) option instead of DATA(31). We think the problem is under control now... fingers crossed. This job calls hundreds of different programs - it is a biggie...

We have sent out an advisory to our programmers to use LOCAL storage with care. I don't suggest for a moment that you should avoid using LOCAL storage - just be careful - if your LOCAL storage size is reasonable you won't run into any problems. In our case, one of our RECURSIVE programs has a LOCAL storage that is greater than 500K.

Where you work it could be that your default STACK settings are not the same as mine. So this may not be a concern for you.
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 Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Iterative use of a REXX script causin... bryonyh CLIST & REXX 4 Fri Jul 28, 2017 12:52 pm

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