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
 

 

Using STORAGE Function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Using STORAGE Function
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

Site Director


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

PostPosted: Wed Aug 27, 2008 1:23 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 27, 2008 11:38 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 27, 2008 7:10 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 27, 2008 7:37 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Aug 27, 2008 10:06 pm    Post subject: Reply to: Using STORAGE Function
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

Site Director


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

PostPosted: Thu Aug 28, 2008 2:28 am    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Sat Aug 30, 2008 5:18 am    Post subject: Reply to: Using STORAGE Function
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts GETMAIN / FREEMAIN versus STORAGE OBT... steve-myers PL/I & Assembler 8 Wed Feb 01, 2017 1:45 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am


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