Some ISPF tricks
How to log off automagically after leaving ISPF
Insert the following line in your TRANS portion of the ISP@PRIM panel (or
whatever primary panel you use):
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.
How to immediately harden ISPF variables
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 */
profile = ZAPPLID || "PROF"
"TBSAVE" profile "LIBRARY(ISPPROF)"
saverc = RC
If saverc = 0
Then ZEDLMSG = "Unsuccessful save attempt"
Else ZEDLMSG = "Successful save attempt"
ZEDSMSG = ZAPPLID "Profile save:" saverc
JES2 Multiple sign-ons, if permitted
For the last 10 years or so, a JES2 option allows the same TSO ID to sign on to
multiple systems, or the same system. The default is to disallow it, but some shops are
allowing it. If your shop allows it, the following REXX EXEC is for you:
/* REXX allocate an ISPF Profile for whichever system you
are on in a multiple TSO environment.
Add to your default logon process before entering ISPF */
/* 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)"
/* - 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 || ")"
/* allocate new profile dataset first time on this system */
"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."
"TSOEXEC CALL 'SYS1.LINKLIB(IEBCOPY)'"
Rcode = rc
"ALLOC F(SYSIN) DA(*) REUSE"
"ALLOC F(SYSPRINT) DA(*) REUSE"
if Rcode ^= 0 then do
say "Unsuccesful allocation of" profile "DataSet"
say "Allocation unchanged from default"
ALLOC F(ISPPROF) OLD REUSE DA(" || profile || ")