In my extensive experience working in the mainframe space, I've come up with some ISPF tricks over the years that I would like to share. Whether they're useful to you is, obviously, up to you to decide.
Before going forward, a quick note about using ISPF CMD(xxx) is in order. I've found that using CMD(xxx) as an argument when you're first getting into ISPF does not work as expected. Therefore, all the commands presented in this article will be invoking ISPF options that, in turn, invoke ISPF/TSO commands.
How to Logoff After Exiting ISPF
While not directly logging you off, this trick can be used so that you logoff as soon as you exit ISPF. People have asked about this one for years, and I have never seen it published anywhere, even though I have shown it to others.
Insert the following line in your TRANS portion of the ISP@PRIM panel (or whatever primary panel you use):
L,'CMD(TSOEXEC LOGOFF)'
You can then issue the command "L" on the ISPF primary panel command line, or you can have your normal logon process issue "ISPF L." This will not take effect, in either case, until you exit ISPF.
Multiple Panels or Commands When Entering ISPF
Some people find that they do the same thing, every time they enter ISPF. For example, you may wish to go into Spool Display & Search Facility (SDSF), Option 3.4 (DataSet List), EDIT, and anything else. How I have done it is by first setting up another command option similar to the previously, yet different:
I,'CMD(%ISPFINI)'
Where ISPFINI is a REXX EXEC (I haven't used CLIST since MVS/ESA 3.1.0 came out with REXX support, circa 1991):
/* REXX
ISPF Start Up REXX EXEC
*/
trace "O"
address "ISPEXEC"
"SELECT PGM(ISPSTRT) PARM(2) SCRNAME(EDIT)"
"SELECT PGM(ISPSTRT) PARM(S.ST) SCRNAME(SDSF)"
"SELECT PGM(ISPSTRT) PARM(3.4) SCRNAME(DSLIST)"
"SELECT PGM(ISPSTRT) PARM(6) SCRNAME(TSO)"
"SELECT PGM(ISPSTRT) PARM(3.14) SCRNAME(COMPARE)"
The above assumes that you have an ISPF configured to support at least four screens. The default is eight, and up to 32 can be supported. Consult your ISPF system programmer if it does not work.
Saving ISPF Profiles Without Exiting
Most people believe that you have to exit ISPF before any profile variables are hardened. Since ISPF profiles are just ISPF tables, there is a better way. You just use the table update facility within ISPF. For example:
/* REXX
save the SPF profile without exiting SPF
*/
trace
address "ISPEXEC"
"VGET ZAPPLID" /*Obtain the ISPF application id
*/
profile = ZAPPLID || "PROF"
"TBSAVE" profile "LIBRARY(ISPPROF)"
saverc = RC
if saverc = 0 then zedlmsg = "Unsuccessful attempt"
else zedlmsg = "Successful attempt"
zedsmsg = ZAPPLID "Profile save:" saverc
"SETMSG MSG(ISRZ001)"
exit 0
Signing On and Using ISPF on Multiple Systems with the Same ID
For the last 10 years or so, a JES2 option has allowed the same TSO userid to sign on to multiple systems, or the same system. The default for this option is to disallow it, but some shops are allowing it. If your shop allows it, the following REXX EXEC is for you:
/* REXX
* To allocate an ISPF Profile for which ever system you are on
* in a multiple TSO environment
* Add to your default logon processing, before entering ISPF
*/
trace
/*
* Cannot re-allocate the ISPF profile data set while in ISPF
*/
If sysvar("SYSISPF") = "ACTIVE" then do
zedsmsg = "Invalid under ISPF"
zedlmsg = "Cannot de-allocate ISPPROF under ISPF"
address "ISPEXEC" "SETMSG MSG(ISRZ000)"
exit 8
end
/*
* build the name of the profile data set
* either userid.< profile> or prefix.userid.< profile>
* ISPF.PROFILE could be different at other shops
*/
system = mvsvar("SYSNAME")
pref = sysvar("SYSPREF")
user = userid()
if user ^= pref then pref = pref || "." || user
oldprof = "'" || pref || ".ISPF.ISPPROF'"
pref = pref || "." || system
profile = "'" || pref || ".ISPF.PROFILE'"
/*
* Does the profile dataset exist?
*/
if sysdsn(profile) = "OK" then do
"ALLOC F(ISPPROF) OLD REUSE DA(" || profile || ")"
exit 0
end
/*
* allocate the new profile dataset first time on this system
*/
drop sysin.
address "TSO"
"ALLOC F(IN) DA(" || oldprof || ") SHR"
"ALLOC F(OUT) DA(" || profile || ") NEW LIKE(" || oldprof || ")"
"ALLOC F(SYSPRINT) DUMMY REUSE"
"ALLOC F(SYSIN) UNIT(DASD) SPACE(1 1) TRACKS REUSE"
sysin.0 = 1
sysin.1 = " C I=IN,O=OUT"
"EXECIO * DISKW SYSIN (FINIS STEM SYSIN."
drop sysin.
"TSOEXEC CALL 'SYS1.LINKLIB(IEBCOPY)'"
code = rc
"ALLOC F(SYSIN) DA(*) REUSE"
"ALLOC F(SYSPRINT) DA(*) REUSE"
"FREE F(IN,OUT)"
if code ^= 0 then do
say "Unsuccesful allocation of" profile "DataSet"
say "Allocation unchanged from default"
end
ALLOC F(ISPPROF) OLD REUSE DA(" || profile || ")"
exit
- vivin_bob's blog
- Login or register to post comments
