Did you know ISPF for z/OS can …
(by Neil Shah and Alan Packett)
Hopefully that caught your attention! ISPF (Interactive System Productivity Facility) for z/OS has many functions: browsing or editing data sets and z/OS UNIX files , submitting batch jobs, issuing TSO commands, REXX execs, and CLISTS, working with dialogs and so on. In this article, we'll discuss a few tips/tricks and highlight some new functions.
First, some oldies, but goodies. These editing tips have saved me countless of hours!
Tip #1 – change/replace text in a subset of the file
ISPF has some powerful editing capabilities. Let's say you wanted to change all occurrences of a certain text only within a certain block, not the entire file. You can do this with a few easy steps.
Mark the block by placing a label (for example, .a) at the start and then another label (for example, .b) at the end
Then your primary edit command would be:
c 'hello' 'goodbye' .a .b all
After you have completed using the labels, you can remove them by issuing the reset label ISPF command: res label
Tip #2 – change characters in certain columns to blanks
Have you ever wanted to change all the characters in certain columns of a file, no matter what the characters are, to blanks? You can use the ISPF picture string to accomplish this. Here's the ISPF help screen for change strings:
So, if we wanted to change all characters in columns 20-72 to blanks, we would use the ISPF edit command:
c p'=' ' ' 20 72 all
Tip #3 – Search-For command
How many times have you said "I know I have an example of using xxxx keyword in my JCL or source code, but I don't remember what member name I have it in"? Sure you can use ISPF option 3.14 to search, but did you know you can also use ISPF option 3.4? Simply enter the data set name in ISPF option 3.4, then enter 'SF' next to the data set name, press <Enter> :
and a pop-up panel will appear, where you can enter your search string and options:
After entering your search information, press <Enter> and ISPF will display the member list panel. If the search string appears in any of the data set members, the keyword "*Found" will be displayed in the Prompt column of those members.
Another way to use the ISPF Search-For utility is by simply displaying the partitioned data set member list and entering the ISPF command 'SRCHFOR string'.
Now, let's discuss some z/OS UNIX capabilities with ISPF.
Tip #4 - View/Edit of z/OS UNIX ASCII files
Products or applications sometimes store data in ASCII format in z/OS UNIX files. To view ASCII files, you can use the iconv command to convert the file to EBCDIC or download the viascii tool from the IBM Tools and Toys for z/OS UNIX System Services page: http://www-03.ibm.com/systems/z/os/zos/features/unix/bpxa1toy.html
But there is another way! You can view z/OS UNIX files encoded in ASCII through ISPF option 3.17 (z/OS UNIX Directory List Utility) using the 'va' ISPF line command. Once you have the directory list expanded, enter 'va' (va stands for View an ASCII file) next to the file you want to view.
We have a file encoded in ASCII. If we use the standard ISPF view 'v', we can't read the (ASCII) file:
But, now we use the 'va' option:
and voila, ISPF converts the file to EBCDIC for display:
What if we wanted to edit the ASCII file? No problem, instead of 'va', we would enter 'ea' (edit an ASCII file) and we can edit the ASCII file. ISPF converts the file to EBCDIC for display and editing. If the file saved, it is saved in ASCII.
Our next topic will be a new function delivered with z/OS 2.2.
Tip #5 - New with z/OS 2.2 - view z/OS UNIX file systems
New with z/OS 2.2, ISPF option 3.17 has a File_Systems pulldown - similar to the ISHELL File_Systems pulldown, but with some enhancements. You can view the z/OS UNIX mount table sorted by file system or by mount point:
Here, we selected the mount table sorted by file system name:
Notice the view is a little different than the ISHELL mount table view. This view uses a tree concept. So where you see the plus sign (+), there are additional entries. If you want to fully expand an entry, enter 'xa' (for expand all), next to the entry, or if you want to expand the entire view, enter 'xa' on the command line.
If you choose option 2 (Mount Table by mount point), it gives you a nice view of the parent/child relationship of file systems.
We hope you enjoyed these tips!
About the authors:
Neil Shah - IBM Global Technology Services - z/OS Systems Programmer
Alan Packett - IBM Systems - ISPF development