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

Using STORAGE Function


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Wed Aug 27, 2008 1:06 am
Reply with quote

Hi

I am trying to use STORAGE function of rexx to override a value at given adress but it is returning null string all the times.

Storage(address,,data) , when i remove data from the function it returns first byte at that place but as soon as i put data it returns null string

Please enlightem me if you have any idea about it

thanks
Anurag
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 27, 2008 1:23 am
Reply with quote

Hello,

It will probably help if you post the code. Please use the "Code" tag on the Reply panel.

When you have a question, please start a new topic for your question rather than posting a reply to some inactive topic.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 27, 2008 11:38 am
Reply with quote

Are you trying to update protected storage ?
Back to top
View user's profile Send private message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Wed Aug 27, 2008 5:46 pm
Reply with quote

Here is the code

Code:
/* REXX GETRC                        */       
                                             
NUMERIC DIGITS(32) /*ENSURE MAX PRECISION*/   
TCB = PTR(540,4)                             
TIOT= PTR(TCB+12,4)                           
JNAM= STG(TIOT,8)                             
SAY 'JOB NAME:' JNAM                         
TRACE I                                       
JNAM1 = STG(TIOT,,'ABCDEFG')                 
JNAM1 = STG(TIOT,8)                           
SAY 'JOB NAME:' JNAM ' ' JNAM1               
EXIT(0)                                       
TRACE OFF                                     
PTR: RETURN C2D(STORAGE(D2X(ARG(1)),ARG(2))) 
STG: RETURN STORAGE(D2X(ARG(1)),ARG(2),ARG(3))
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 27, 2008 7:10 pm
Reply with quote

I think that you will find that only APF authorised programs, which are usually under the control of the sysprogs and closely monitored by the security people, are allowed to update storage in flight.

That is what I found out when trying to update a storage location with REXX myself.
Back to top
View user's profile Send private message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Wed Aug 27, 2008 7:18 pm
Reply with quote

Thanks Expat,

Can you show me some other examples where I can check that storage works

angt
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 27, 2008 7:37 pm
Reply with quote

Not that I know of. Updating storage on the fly isn't really part of my job function, and I only tried it out a few times when there was nothing much else to do.

The function quite happily retrieves data from the given location, but does not update it.

Might have a play with the SAS equivilent of PEEK and POKE, but then again that all depends on time availability.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Aug 27, 2008 10:06 pm
Reply with quote

<good Pedro>
You should just submit the job with a correct name! Why would you want to change the name after submitting? You cannot update system control blocks, but should be able to update your private storage.

You can use IPCS to find control blocks in your private storage. And given the addresses, use STORAGE to change it from rexx.
</good Pedro>

<evil Pedro>
You might be able to zap system storage using the TESTAUTH command. But you can easily corrupt system storage, so I do not recommend it. When they find out who crashed the system, they will be upset. TESTAUTH is usually protected from casual use.
</evil Pedro>
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 28, 2008 2:28 am
Reply with quote

Hello,

Quote:
But you can easily corrupt system storage, so I do not recommend it. When they find out who crashed the system, they will be upset.
Unless you have direction from your management you should not even attempt it.

Some places i've supported find this sort of "tinkering" grounds for termination. It is very likely that there is no business requirement to do this. Learning is one thing, this is more like sabotage/subtrefuge.
Back to top
View user's profile Send private message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Sat Aug 30, 2008 12:29 am
Reply with quote

Thanks All for your views


Pedro what is IPCS ?
Back to top
View user's profile Send private message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Sat Aug 30, 2008 1:55 am
Reply with quote

angt wrote:
Thanks All for your views


Pedro what is IPCS ?
I got some thing like Interactive Problem Control Fclty but I am not sure how to get control blocks in my private storage
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sat Aug 30, 2008 5:18 am
Reply with quote

I suggest your application allocate a control block that includes a character field; perhaps some 8 or 16 character value that should be unique to your application. Many system control blocks typically have an 'ID' field for this purpose.

Then use IPCS to search through storage looking for your 'eyecatcher'. Then you will have the address of your control block. This is sort of a brainstorm session. I have not used IPCS in this fashion, but only surmise that it is possible.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts CICS vs LE: STORAGE option CICS 0
Search our Forums:

Back to Top