3
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): 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. 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 */ address "ISPEXEC" "VGET ZAPPLID" 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 "SETMSG MSG(ISRZ001)" Exit 0 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

Ispf Tricks

Embed Size (px)

Citation preview

Page 1: Ispf Tricks

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):

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.

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 */address "ISPEXEC""VGET ZAPPLID"profile = ZAPPLID || "PROF""TBSAVE" profile "LIBRARY(ISPPROF)"saverc = RCIf saverc = 0 Then ZEDLMSG = "Unsuccessful save attempt" Else ZEDLMSG = "Successful save attempt"ZEDSMSG = ZAPPLID "Profile save:" saverc"SETMSG MSG(ISRZ001)"Exit 0

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"

Page 2: Ispf Tricks

zedlmsg = "Cannot de-allocate ISPPROF under ISPF" address "ISPEXEC" "SETMSG MSG(ISRZ000)" exit 8end

/* - 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 || "." || useroldprof = "'" || pref || ".ISPF.ISPPROF'"pref = pref || "." || systemprofile = "'" || pref || ".ISPF.PROFILE'"

/* Does the profile dataset exist? */if sysdsn(profile) = "OK" then do "ALLOC F(ISPPROF) OLD REUSE DA(" || profile || ")" exit 0end

/* 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 = 1sysin.1 = " C I=IN,O=OUT""EXECIO * DISKW SYSIN (FINIS STEM SYSIN."drop sysin."TSOEXEC CALL 'SYS1.LINKLIB(IEBCOPY)'"Rcode = rc"ALLOC F(SYSIN) DA(*) REUSE""ALLOC F(SYSPRINT) DA(*) REUSE""FREE F(IN,OUT)"if Rcode ^= 0 then do say "Unsuccesful allocation of" profile "DataSet" say "Allocation unchanged from default"endALLOC F(ISPPROF) OLD REUSE DA(" || profile || ")Exit 0