View previous topic :: View next topic
|
Author |
Message |
mosinjamadar
New User
Joined: 26 Sep 2007 Posts: 42 Location: pune
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
What's wrong with COMMAREA?
O. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
mosinjamadar
New User
Joined: 26 Sep 2007 Posts: 42 Location: pune
|
|
|
|
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 |
|
|
|