View previous topic :: View next topic
|
Author |
Message |
Lynne
Active User
Joined: 15 Jan 2015 Posts: 102 Location: USA
|
|
|
|
a few years ago, I wrote a rexx application that many people in my organization are using. It automatically sets up multiple swap screens of the user's choice by typing in ISPF var instead of ISPF when you bring up ISPF.
I am writing a function in an ISPF application I've created that will do the same thing, but the user can just enter what they want the swap screens to be set up with the scrnnames they want.
but I ran into a snag - in that I cannot retrieve/update the ISR variable I need from my new application. I've always thought of the ISR application as the "parent" application in ISPF. That the variables in the SHARED pool would be retrieved from the ISR application first. they would be the "default" variables. Then your profile pool would have those variables you create for your new application, with the profile pool overriding the default variables.
but.. I was wrong in that assumption.. and never realized it because I've never had to use an ISR specific variable before.
so.. how do I update the ISR variable? I looked, and there is no "application" option for VGET or VPUT. so, I assume I have to do a SELECT specifying application(ISR)? then do the VGET - set up my rexx variables with that, then select back to my new application?
is there any other direct way to update an ISR variable? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Quote: |
ISR specific variable |
Can you be more specific about what the variable is? Why do you need the one in the ISR profile? Why not define a new one in your applid?
---
I think you are sort of right:
1. SELECT to ISR applid
2. VGET variable
3. exit to return back to calling program.
But the rexx variables will not survive the transition between applids. I think you will need to save the information to a data set. |
|
Back to top |
|
|
Lynne
Active User
Joined: 15 Jan 2015 Posts: 102 Location: USA
|
|
|
|
the variable is one I created - I tried to make it something that ISR wouldn't use, so I made it my name, "lynne". I don't think ISPF will ever use that.
but the reason it has to be in the ISR application is because that is where the ISPF command picks it up. If you are on TSO, and type ISPF lynne, and you have previously stored the variable lynne with this value: 'ISPF;Swapbar On;Scrname ISPF;Start 6;Scrname TSOCMD;SWAP ISPF", then the ISPF command will pick up the contents of the ISR variable lynne and execute it. You will open ISPF and see 2 screens with a swapbar below.
so, because ISPF opens with only one application, ISR, this variable has to reside in the ISR application.
look up ISPSTART cmd_stack_var_name here:
www.ibm.com/docs/en/zos/2.1.0?topic=siic-parameters |
|
Back to top |
|
|
Lynne
Active User
Joined: 15 Jan 2015 Posts: 102 Location: USA
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
Interesting problem, I can see that it sometimes would be useful to be able to get a variable from another ISPF pool. It can be done by running an external program, see the sample below. But as Pedro points out, the rexx variables will not survive the transition between applids, nor can you use the stack or the return value. You do not, however, need to a dataset, you can store REXX variables in storage using either program STEMPUSH from cbttape.org file 411, or program REXXSTOR or REXXGBLV from cbttape.org file 669, the latter is used in the sample.
Call external routine..
Code: |
say 'Retrieve var TVSBK001 in pool ZTAP'
address ispexec "select cmd(zgetvar ztap TVSBK001)"
say 'Value =' RexxGblv('return var($getvar)') |
The ZGETVAR program...
Code: |
/* ZGETVAR - get ISPF variable from specified pool */
parse source sys type whoami ddn whereami .
arg pool name .
address ispexec
/* ensure correct applid for dialog */
"vget zapplid"
if zapplid<>pool then do
"Select cmd(%"whoami arg(1)") newappl("pool")"
exit rc
end
/* stack var */
"vget" name "profile"
exit RexxGblv('add var($getvar) valvar('name')') |
|
|
Back to top |
|
|
Lynne
Active User
Joined: 15 Jan 2015 Posts: 102 Location: USA
|
|
|
|
interesting solution. but I do need to store this particular variable in the ISR pool, because that is where ISPF expects to find it in the initial ISPF command.
What I ended up doing is this:
main application panel:
zsel cmd_A
cmd_A:
address ispexec "SELECT CMD(cmd_B) NEWAPPL(ISR) PASSLIB"
cmd_B:
read ISR appl variable
display panel with ISR appl variable values
(user can modify or just return)
save user modifications in ISR variable
exit (to cmd_A)
so basically - I am calling cmd_B to execute in application ISR, then return.
I am able to do this because I realized I really did not to pass any variables from my application to ISR. I could do everything in ISR, but still call it from my application. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
Sorry, missed the 'how do I update the ISR variable' part. Here is a pgm to do that using standard features. See the sample call in the comment section.
Code: |
/* rexx
ISPPUTV - write ISPF variable in specified profile pool
Parm: poolname varname data
Sample call: rc = IspPutV('ztap TEST001 Just testing')
*/
parse source . . whoami .
parse arg pname vname data
upper pname vname
address ispexec
/* ensure correct applid for dialog */
"vget zapplid"
if zapplid<>pname then do
"Select cmd(%"whoami arg(1)") newappl("pname")"
exit 0
end
/* update varaible */
zz=Value(vname,data)
"vput" vname "profile"
exit rc |
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
And here is a way to retrieve variables using standard features.
Code: |
/* rexx
ISPGETV - return ISPF variable from specified profile pool
Parm: poolname varname
Sample call: v = Ispgetv('ztap TEST001')
*/
parse source sys type whoami ddn whereami .
arg pname vname .
address ispexec
"control errors return"
/* ensure correct applid for dialog */
"vget zapplid"
if zapplid<>pname then do
"Select cmd(%"whoami arg(1)") newappl("pname")"
if rc<>0 then exit ''
/* get data after call */
"tbtop $ISPGETV" /* get */
"tbskip $ISPGETV" /* first row */
"tbend $ISPGETV"
exit Value(vname)
end
/* get and save var */
"vget" vname "profile"
if rc<>0 then exit rc
"tbend $ISPGETV "
"tbcreate $ISPGETV names("vname")"
"tbadd $ISPGETV "
exit 0
|
|
|
Back to top |
|
|
Lynne
Active User
Joined: 15 Jan 2015 Posts: 102 Location: USA
|
|
|
|
Thanks, Willy. Saving your routines, as I think they might be handy for using any variable from another ISPF application. |
|
Back to top |
|
|
|