Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6966
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: 2502
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: 2502
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 Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts GETMAIN / FREEMAIN versus STORAGE OBT... steve-myers PL/I & Assembler 8 Wed Feb 01, 2017 1:45 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us