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
 
Storage violation with a variable to a pointer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Storage violation with a variable to a pointer
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: 2360
Location: Israel

PostPosted: Wed Mar 18, 2009 7:01 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 18, 2009 7:01 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Mar 18, 2009 7:06 pm    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 18, 2009 9:15 pm    Post subject: Reply to: Storage violation with a variable to a pointer
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Thu Mar 19, 2009 8:25 pm    Post subject: Reply to: Storage violation with a variable to a pointer
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    Post subject: Reply to: Storage violation with a variable to a pointer
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    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 sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 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 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