Monday, December 19, 2011

Productivity - Shortcuts in ISPF

How many times have you seen someone typing =3.4, =2, =sdsf, start 3.4. I do not like that. But, I am not totally against it. I think if one understands what happens in the background, they would appreciate what I have to say.

Screen and Panel are used interchangeably in the following write-up. They both mean one and the same.

‘=’ on any screen informs ISPF that whatever follows the ‘=’ is a Primary panel input. In most sites ISR@PRIM or ISP@PRIM is the primary ISPF panel and everything drives off of it. Say one is in edit screen (=2 screen) and on the EDIT screen, he types =3.4 on the command line and presses ENTER. What ISPF does internally, is terminate the EDIT screen, gets to Primary screen and invokes 3.4 on the Primary screen. If your intention was to go to 3.4 and stay there, this approach is fine. If your intention was to check something on 3.4 and get back to EDIT (=2) screen, this is waste of processing power.  What if you could stack ISPF screen ? i.e. from EDIT screen if you would type DS to get to 3.4, finish all your work on that screen and press PF03 to return back to EDIT screen ? Now such a function, I would say improves productivity. And guess what, this could be done!

I wonder how many of us know about command tables in ISPF applications. All ISPF services are grouped into applications. ISPF, PDF are grouped as ISP application, EDIT falls under ISR application & SDSF falls under ISF application. Each application has something called a command table. Command table is nothing but an ISPF table which contains the short cuts and the associated commands against the shortcuts. E.g. ‘ED’ can be defined as short cut to =2 (EDIT screen), similarly DS for =3.4. The problem is IBM provides a few shortcuts which are commonly used by various shops. There are many which each site has to customize.

The command table information is stored in the ISPTLIB DD member applCMDS. ‘appl’ denotes the application prefix. If the application is ISPF or PDF, then the command table member name would be ISPCMDS. The main problem is ISPF holds this member exclusive, so you cannot open this member separately. However, what you can do is use ISPF table functions to write records to this member.

The command table consists of 4 columns. They are
ZCTVERB – 8 character verb which indicates the shortcut
ZCTTRUNC – number which indicates the number of characters which is sufficient to consider a match e.g. EDIT could be the verb, and if the TRUNC is 2, then ED would suffice for ISPF to recognize it as a command.
ZCTACT – Action command. For EDIT the command would be “SELECT PGM(ISREDIT) PARM(P,ISREDM01) SCRNAME(EDIT)”
ZCTDESC – description. English description of the above command.

Find the sample REXX which I use to add my entries to ISPCMDS. I invoke the REXX each (once) time I enter ISPF. These entries are active till I exit out of ISPF. DO NOT OVERWRITE THE SYSTEM ISPCMDS. This member would be used by others, if you mess up something, everyone has to suffer.

Sample REXX:

/* Rexx */         zctverb=”BR”                                           
zcttrunc=”0”
zctact=”SELECT PGM(ISRBRO) PARM(ISRBRO01) SCRNAME(VIEW)”             
zctdesc=”BROWSE SCREEN”                        
Address ISPEXEC “TBADD ISPCMDS”     

zctverb=”ED”                                               
zcttrunc=”0”
zctact=”SELECT PGM(ISREDIT) PARM(P,ISREDM01) SCRNAME(EDIT)”      
zctdesc=”EDIT SCREEN”                   
Address ISPEXEC “TBADD ISPCMDS”     
Exit 
With these entries, I would be able to invoke Browse (or Edit) from any ISPF screen by typing BR (or ED respectively) on the command line. Browse (or Edit) will be stacked on top of the current ISPF screen.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.