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

how to update an ISR appl var from another appl


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lynne

New User


Joined: 15 Jan 2015
Posts: 72
Location: USA

PostPosted: Sat Jun 18, 2022 4:17 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Jun 18, 2022 5:10 am
Reply with quote

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
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 72
Location: USA

PostPosted: Sat Jun 18, 2022 7:22 am
Reply with quote

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
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 72
Location: USA

PostPosted: Sat Jun 18, 2022 7:54 am
Reply with quote

well, I just learned something new. I didn't need to create a new variable name. I could have used ZSTART, and the multiple screens you define in the ZSTART variable will come up just with the command ISPF.

These Share Conferences have some good information.

share.confex.com/share/124/webprogram/Handout/Session16631/ISPF%20Hidden%20Treasures%20Parts%20I%20%26%20II.pdf
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 629
Location: Denmark

PostPosted: Sat Jun 18, 2022 3:22 pm
Reply with quote

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
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 72
Location: USA

PostPosted: Mon Jun 20, 2022 10:01 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 629
Location: Denmark

PostPosted: Mon Jun 20, 2022 12:57 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 629
Location: Denmark

PostPosted: Mon Jun 20, 2022 1:30 pm
Reply with quote

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
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 72
Location: USA

PostPosted: Tue Jun 21, 2022 12:10 am
Reply with quote

Thanks, Willy. Saving your routines, as I think they might be handy for using any variable from another ISPF application.
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Read a flat file and update DB2 table JCL & VSAM 2
No new posts DB2 SQL query to read and update data... DB2 12
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
No new posts Group comparison/update between two f... DFSORT/ICETOOL 10
No new posts refresh data from production - update... DB2 1
Search our Forums:

Back to Top