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
 
Scope of Memory for a Variable During Link

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
rathinakarthik

New User


Joined: 25 Jul 2006
Posts: 24

PostPosted: Wed Mar 05, 2008 2:46 am    Post subject: Scope of Memory for a Variable During Link
Reply with quote

Hi,

I am Linking from Program A to Program B.
In Program B i am storing some values in Working storage (B).I am passing the values back to Program A via a common Pointer.
I am dereferencing the pointer and using the values.

Now my clarification is ,whether the memory (Working storage of B) will be made availble to for use after this Pgm B ends or the entire task completes.

Please advise

Thank you.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Mar 05, 2008 2:51 am    Post subject:
Reply with quote

As I see it, the return back from a EC LINK will free all storage associated with the linked level, i.e., the pointers 'may' no longer point to valid values.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Thu Mar 06, 2008 10:06 pm    Post subject: Scope of Memory for a Variable
Reply with quote

In a LINK-API, a new LE "Enclave" (love this term), is created and upon return, is terminated, with all WS returned to the operating system.

So, I would NOT rely upon the ability of the LINKING program to address WS which "had" (past tense) existed in the LINKED-TO program, who has now returned control to the LINKER. You may find that you can get away with this in a TEST environment, but as soon as this is placed into Production, all bets are off and you'll find yourself chasing down some "opportunities". icon_wink.gif

If you really need addressability, then you'll need GETMAIN storage, acquired by either the LINKER or the LINKEE.

Then, this storage address and its data will be preserved until task termination. However, the LINKER must have the ability to obtain this address, so it might be best if the storage were acquired first by the LINKER.

Try to avoid GETMAIN SHARED, because if an abend occurs after obtaining this SHARED storage, this storage becomes orphaned and cannot be addressed until the region is recycled. A high degree of orphaned storage may result in the region terminating with an "S80A" abend.

Another issue regarding SHARED storage is that it must be explicitly FREEMAINed and (unlike non-SHARED GETMAIN storage) will NOT automatically be FREEMAINed upon task termination.

The bottom line is, try not to use GETMAIN SHARED and if you do, understand the pitfalls.

One last thought. Have you looked into EXTERNAL WS data? This might also be a viable option.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
rathinakarthik

New User


Joined: 25 Jul 2006
Posts: 24

PostPosted: Mon Mar 10, 2008 5:36 pm    Post subject: Reply to: Scope of Memory for a Variable During Link
Reply with quote

Thank you Bill,
I will try the same.
Thank 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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm

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