SlideShare a Scribd company logo
1 of 2
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 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)"
  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 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."
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"
end
ALLOC F(ISPPROF) OLD REUSE DA(" || profile || ")
Exit 0

More Related Content

Similar to Some ISPF Tricks

DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03Linda Hagedorn
 
04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)Alexandre Moneger
 
SecZone 2011: Scrubbing SAP clean with SOAP
SecZone 2011: Scrubbing SAP clean with SOAPSecZone 2011: Scrubbing SAP clean with SOAP
SecZone 2011: Scrubbing SAP clean with SOAPChris John Riley
 
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_wormDefcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_wormguest785f78
 
Using packet-tracer, capture and other Cisco ASA tools for network troublesho...
Using packet-tracer, capture and other Cisco ASA tools for network troublesho...Using packet-tracer, capture and other Cisco ASA tools for network troublesho...
Using packet-tracer, capture and other Cisco ASA tools for network troublesho...Cisco Russia
 
One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)Ferruh Mavituna
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Prajal Kulkarni
 
Endevor api an introduction to the endevor application programming interface
Endevor api   an introduction to the endevor application programming interface Endevor api   an introduction to the endevor application programming interface
Endevor api an introduction to the endevor application programming interface Kevin Grimes
 
Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?Precisely
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKYoungHeon (Roy) Kim
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W mattersAlexandre Moneger
 
05 - Bypassing DEP, or why ASLR matters
05 - Bypassing DEP, or why ASLR matters05 - Bypassing DEP, or why ASLR matters
05 - Bypassing DEP, or why ASLR mattersAlexandre Moneger
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012hwilming
 
02 - Introduction to the cdecl ABI and the x86 stack
02 - Introduction to the cdecl ABI and the x86 stack02 - Introduction to the cdecl ABI and the x86 stack
02 - Introduction to the cdecl ABI and the x86 stackAlexandre Moneger
 

Similar to Some ISPF Tricks (20)

DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03DB2 Systems Programming Tools of the Trade NA07B03
DB2 Systems Programming Tools of the Trade NA07B03
 
04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)
 
SecZone 2011: Scrubbing SAP clean with SOAP
SecZone 2011: Scrubbing SAP clean with SOAPSecZone 2011: Scrubbing SAP clean with SOAP
SecZone 2011: Scrubbing SAP clean with SOAP
 
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_wormDefcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
Defcon_Oracle_The_Making_of_the_2nd_sql_injection_worm
 
Using packet-tracer, capture and other Cisco ASA tools for network troublesho...
Using packet-tracer, capture and other Cisco ASA tools for network troublesho...Using packet-tracer, capture and other Cisco ASA tools for network troublesho...
Using packet-tracer, capture and other Cisco ASA tools for network troublesho...
 
One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)One Click Ownage Ferruh Mavituna (3)
One Click Ownage Ferruh Mavituna (3)
 
Firebird
FirebirdFirebird
Firebird
 
LogStash in action
LogStash in actionLogStash in action
LogStash in action
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 
Endevor api an introduction to the endevor application programming interface
Endevor api   an introduction to the endevor application programming interface Endevor api   an introduction to the endevor application programming interface
Endevor api an introduction to the endevor application programming interface
 
Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?Does Your IBM i Security Meet the Bar for GDPR?
Does Your IBM i Security Meet the Bar for GDPR?
 
PL/SQL
PL/SQLPL/SQL
PL/SQL
 
Download It
Download ItDownload It
Download It
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters
 
05 - Bypassing DEP, or why ASLR matters
05 - Bypassing DEP, or why ASLR matters05 - Bypassing DEP, or why ASLR matters
05 - Bypassing DEP, or why ASLR matters
 
Data Encryption at Rest
Data Encryption at RestData Encryption at Rest
Data Encryption at Rest
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012
 
02 - Introduction to the cdecl ABI and the x86 stack
02 - Introduction to the cdecl ABI and the x86 stack02 - Introduction to the cdecl ABI and the x86 stack
02 - Introduction to the cdecl ABI and the x86 stack
 

More from Dan O'Dea

Basic IMS For Applications
Basic IMS For ApplicationsBasic IMS For Applications
Basic IMS For ApplicationsDan O'Dea
 
Advanced REXX Programming Techniques
Advanced REXX Programming TechniquesAdvanced REXX Programming Techniques
Advanced REXX Programming TechniquesDan O'Dea
 
TSO Productivity
TSO ProductivityTSO Productivity
TSO ProductivityDan O'Dea
 
Reading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAMReading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAMDan O'Dea
 
White Paper, System Z Dataset Naming Standards
White Paper, System Z Dataset Naming StandardsWhite Paper, System Z Dataset Naming Standards
White Paper, System Z Dataset Naming StandardsDan O'Dea
 

More from Dan O'Dea (8)

UVP, Mine
UVP, MineUVP, Mine
UVP, Mine
 
Basic VSAM
Basic VSAMBasic VSAM
Basic VSAM
 
Basic IMS For Applications
Basic IMS For ApplicationsBasic IMS For Applications
Basic IMS For Applications
 
Advanced REXX Programming Techniques
Advanced REXX Programming TechniquesAdvanced REXX Programming Techniques
Advanced REXX Programming Techniques
 
TSO Productivity
TSO ProductivityTSO Productivity
TSO Productivity
 
VSAM Tuning
VSAM TuningVSAM Tuning
VSAM Tuning
 
Reading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAMReading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAM
 
White Paper, System Z Dataset Naming Standards
White Paper, System Z Dataset Naming StandardsWhite Paper, System Z Dataset Naming Standards
White Paper, System Z Dataset Naming Standards
 

Some ISPF Tricks

  • 1. 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 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"
  • 2. 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 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." 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" end ALLOC F(ISPPROF) OLD REUSE DA(" || profile || ") Exit 0