IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Storage violation with a variable to a pointer


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mosinjamadar

New User


Joined: 26 Sep 2007
Posts: 42
Location: pune

PostPosted: Wed Mar 18, 2009 6:45 pm
Reply with quote

Hi ,

I have one doubt .i have defined one working storage variable in my program with X(3200) .after processing can I assign the address of that
variable to a pointer which will be accessed by the other online program
I am coding it like below mentioend
SET CA-LINK-RESP-ADDR-1 TO ADDRESS OF WS-GIB-RESP
CA-LINK-RESP-ADDR-1 is defined as pointer
its working fine but some ppl are saying it will give storage violation
please clerify it
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Mar 18, 2009 7:01 pm
Reply with quote

What's wrong with COMMAREA?

O.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Mar 18, 2009 7:01 pm
Reply with quote

As long as the actual storage stays available, passing the pointer should cause no problems.
The trick is how you preserve the actual storage.
Improper use can result in a storage violation.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Mar 18, 2009 7:06 pm
Reply with quote

you will have no problem with the pointer as long as you xlink or call your subprogram. the xlink and/or call will keep the caller in memory.

if you do an xctl, or start trans, you will have problems.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Mar 18, 2009 9:15 pm
Reply with quote

By chance, is this a Remote Link (DPL)?

You can't pass a storage-address from one region to another. The address must be local.

Regards,
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Mar 19, 2009 8:25 pm
Reply with quote

If you're compiling the LINKING program using the OPTIMIZE option, sometimes a WS field is not recognized unless it's been previously accessed.

In order to "fake out" the OPTIMIZER, move SPACE to the first byte of this 32000 byte WS field, using reference modification.

As Dick has said, if you use an XCTL, the WS address will be invalid. You can get around this by issuing a GETMAIN prior to the XCTL and pass the address of this GETMAIN area in the commarea. But, as soon as the task ends, the GETMAIN storage goes away, via an implicit FREEMAIN by CICS.

In regards to a START TRANSID, passing a WS address or a GETMAIN address will be invalid. The only way to preserve this storage and allow it to be addressable in the started task, would be to use a GETMAIN SHARED (I'm not an advocate), but this requires an explicit FREEMAIN be issued before the end of the task. Without this FREEMAIN, this storage becomes orphaned and is no longer addressable by the CICS region until it is recycled.

Things to consider....

Regards,
Back to top
View user's profile Send private message
mosinjamadar

New User


Joined: 26 Sep 2007
Posts: 42
Location: pune

PostPosted: Fri Mar 20, 2009 11:46 am
Reply with quote

Thaks to all of you for your valuable suggestions .

so to conclude it accourding to my understanding now

1) WS-address should not have any problem while passing untill i m doing XCTL and start tran

so we can assign working storage address to a pointer

hope I have got it correctly !!!

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts CICS vs LE: STORAGE option CICS 0
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Insufficient Storage ABENDS & Debugging 7
Search our Forums:

Back to Top