IBM provides some sample ISPF edit macros in the SYS1.SISPSAMP library. These are useful as is or as a basis for learning to write your own edit macros. Today we will discuss a few of them.
First of all, to use the edit macros we need to ensure that SISPSAMP is allocated. This can be done be including it in our login procedures under the SYSPROC concatenation, or with an ALLOC command. For example:
ALLOC F(SYSPROC) DA(‘SYS1.SISPSAMP’) SHR REU
this is a TSO command, so remember to prefix it with TSO if you are entering it from an ISPF panel. Once they are allocated, edit macros are always called by entering the member name on the command line of your ISPF edit session.
ISRONLY:
Only is an edit macro that combines the functionality of the FIND and EXCLUDE macros. It will display only the lines with the string that you specify. Instead of doing command X ALL;F <string> ALL you can use command ONLY <string>.
ISRBOX:
Box is an edit macro that inserts an box drawn from characters into the open member you are editing. The box’s top left corner will start at your cursor position. It will then reposition your cursor inside of the box so you can begin to enter a note in it. It is useful for highlighting notes for yourself or other programmers.
TSO & ISPF DDnames
But wait… something is different about these two edit macros – apart from their functionality.
If you notice when viewing the members, ISRONLY has a /* REXX */ comment declaration at the top. ISRBOX does not, this is because ISRBOX is a CLIST program. Edit macros can be written in REXX or CLIST, and you will often see a combination of both where CLIST commands are used in a REXX program.
It is important we recognize the difference between the two, because z/OS processes them differently. That is why we allocated SISPSAMP to the SYSPROC concatenation, which can handle running both REXX and CLIST statements. If we were to allocate it to another concatenation like SYSEXEC, which can only process REXX statements, the CLIST macros would return with syntax errors because they are being read as if they are REXX.
This also goes for other ddname concatenations too. If you misallocate a panel to ISPMLIB, when it was supposed to be under ISPPLIB then your panels will most likely not display.
The base ISPF library types are the following:
- ISPMLIB – Message library
- ISPPLIB – Panel library
- ISPSLIB – Skeleton library
- ISPTLIB – Table input library
- ISPTABL – Table output library
- ISPFILE – File tailoring output file
- ISPLLIB – Load module
- ISPILIB – Image library
Likewise, TSO has
- SYSPROC – TSO/E CLISTs and REXX execs
- SYSEXEC – Only REXX
Leave a comment