MVS TOOLS AND TRICKS OF THE TRADE FEBRUARY 2002 Sam Golob MVS Systems Programmer P.O. Box 906 Tallman, New York 10982 Sam Golob is a Senior Systems Programmer. He also participates in library tours and book signings with his wife, author Courtney Taylor. Sam can be contacted at sbgolob@cbttape.org. Information about the CBT MVS Tapes can be found on the web, at http://www.cbttape.org. THE NEW "REVIEW" Today I'm going to talk about a program that's been here for over 20 years, but there's a good reason to deal with it now. First, the program is constantly being improved upon by its current author. Second, not everybody knows about it, as I discovered yesterday in a discussion with a fellow longtime systems programmer. This program is a TSO command named REVIEW, and its primary use is for browsing datasets. REVIEW's original author is Bill Godfrey, who has been a tremendous pioneer in developing software tools for MVS systems programmers to use. Bill prides himself on having started a lot of the development paths for important tools many of us now take for granted, and he is happy when the programs he's developed, are improved upon by others. Bill Godfrey's latest version of REVIEW was about 4000 lines, in source code. Greg Price (starting back in 1984) picked up the cudgel, and the source code for REVIEW, in Greg's capable hands, now is approximately 30000 lines long. It's very obvious, to anyone who looks at the source code, that the REVIEW command, in its current incarnation, can do an awful lot of things. It would therefore be very profitable for us, to get better acquainted with this extremely capable tool. By the way, Greg Price is also the author of a fine MVS monitor product, which is a vendor product, called IMON, that runs under TSO, and which does not need ISPF. I have profitably used Greg's clever and original IMON product for many years. Although both REVIEW and IMON do not need ISPF, REVIEW can take advantage of ISPF if it is present in the environment. To find out more about IMON, and REVIEW, go to Greg's URL: http://www.prycroft6.com.au A FEW OF THE CAPABILITIES OF REVIEW REVIEW is a TSO command which does not need ISPF, but if you are invoking REVIEW under ISPF, REVIEW will use the ISPF EDIT and BROWSE facilities if they are asked for. The latest release of REVIEW as of this writing (Release 35.4) will accept EDIT and BROWSE primary commands from the command line of a REVIEW screen, if REVIEW happens to have been invoked in an ISPF environment. This is a significant extra feature, recently added to REVIEW, and it will prove to be very handy to have. REVIEW now displays a member list, if pointed to a partitioned dataset (PDS) or a PDSE, and it can look at program objects stored in a PDSE. REVIEW can look at, and DELINK ordinary load modules, with the help of David Noon's DELINKI program that it calls. REVIEW can also be used to look at VSAM files, HFS files, DB2 tables, and it has IMS browsing capability. REVIEW can sequentialize (=OFFLOAD) members of a pds, and load modules, into a sequential output dataset. And I haven't even scratched the surface of REVIEW's new powers. REVIEW has its famous capability of browsing and formatting SMF records. This capability enables the system programmer, or anyone else with the appropriate authority, to look at SMF records on disk or tape, and pick out only the records of a certain type, or which have been generated by a certain userid. In turn, it becomes very easy to find out who deleted a dataset and when, to pick one example of this powerful use of the REVIEW command. REVIEW can access files by way of their ddnames, if you invoke it by saying REVIEW ddname FILE, using the extra keyword of FILE. When used this way, REVIEW will also access file concatenations, and will display combined member names and their concatenation numbers. You can use this capability of REVIEW to explore the ISPF file concatenations allocated to your TSO session, and for other similar purposes. (NOT SO) BASICS OF "REVIEW" As we said before, the simple way to invoke REVIEW is to say (under TSO) REVIEW dataset.name . Once this is done, you get a full screen view of the contents of the beginning of the dataset. You can enter the HEX command at the command line on top of the fullscreen display. This will give a HEX display of the data, spread horizonatally and not vertically, making it different from the HEX display of ISPF BROWSE. All this is simple enough. REVIEW offers some basic advantages over ISPF BROWSE, for large datasets. If the file has record format FB, so that its end can be computed with some accuracy, REVIEW will advance the file to the BOTTOM or by a large number of lines, almost instantaneously. It does this by calculating the TTR of the dataset where, say the millionth line would be (if that's where you told it to advance to), and it'll go there right away. If the record format of the large dataset is variable (VB), so that REVIEW can't calculate the destination easily, REVIEW will still offer an advantage over ISPF BROWSE. REVIEW does the following: Suppose you're looking at a dataset, and you told REVIEW to go down 100000 lines. REVIEW is taking it's time, and you want to know how far it got. Simply press RESET and PA1, and REVIEW will stop in its tracks, telling you exactly how far it got. This is also a tremendous advantage over ISPF BROWSE, when looking at large datasets, such as PTF files and SMF datasets. REVIEW offers other advantages over ISPF BROWSE, as I've implied. For example, you don't have the 9999 line restriction when you're going up or down. You can tell REVIEW to go down 10 million lines (DOWN 10000000) and it'll do it. If you learn how to use TTRs of a dataset, to tell you a record's position in the dataset, you can use REVIEW's NEWTOP subcommand to start looking at the dataset from a certain TTR, rather than from the TOP. That has an advantage when trying to browse deleted members of a PDS, or when trying to pass an I/O error when rescuing data from a defective dataset. I can't begin to describe the many "extra" things you can do with REVIEW over ISPF BROWSE, but I can refer you to REVIEW's HELP member, that comes with its "install pds". By the way, while we're talking about REVIEW's TSO HELP member, I have to mention that REVIEW itself has a program alias called HEL, which is a fullscreen TSO SYSHELP browser. HEL is a TSO command which searches your TSO session's SYSHELP ddanme concatenation for the HELP member that you're looking for. And when you use the HEL command, you have fullscreen FIND, UP, DOWN, and other capabilities, which will assist you in locating the information about the TSO command and its subcommands which you'll need, especially in large HELP members. HOW CAN YOU GET "REVIEW" You can download REVIEW directly from Greg Price's web site: http://www.prycroft6.com.au , or you can get it from the enormous CBT Tape collection, where REVIEW is available as part of File 134. Load modules for REVIEW and its related programs, can be found in the CBT Tape collection, on File 135. The CBT Tape collection is entirely free and available to everyone. One way you can get to the CBT Tape URL, is through NaSPA's web site, www.naspa.com . I would suggest grabbing the REVIEW load modules from File 135, looking at everything that starts with REV** and at HEL, and at DELINKI, and copying them all into a load library which is accessible to your TSO session, either by way of ISPLLIB, or STEPLIB, or in the Link List. Then, I'd look at two documents to help get started. The first is the HELP member for REVIEW in File 134, called REVIEW#. If you copy this member into one of the libraries in your SYSHELP concatenation, and rename it as REVIEW, you can then issue the TSO command: HEL REVIEW to look at the contents of this member. The next thing I'd recommend, is to look at the member called REVNOTES, which describes recent improvements made to the REVIEW command by Greg Price, and which will teach you a lot of the new things that Greg has recently put in. If you want to learn the details about the features of REVIEW which Greg mentions in his REVNOTES member, just look them up in the REVIEW# member, or say HEL REVIEW, after you've installed the REVIEW help member in a SYSHELP library of your TSO session. A third place to look, for help in the more obscure features of the REVIEW command, is in the source code itself, at the beginning. There, Greg gives a summary of all the changes that were made to REVIEW, over its many releases, and this history is many pages long. From looking there, you can learn a lot about REVIEW's intricacies. Once you learn that a feature exists, you can again refer to the TSO help member for REVIEW, to learn how to use it. FORMATTING AND COPYING RECORDS The REVIEW command "knows" how to format a large variety of records. REVIEW can format IDR records, when REVIEWing load modules, and it can format DSCB entries for a dataset (when REVIEWing a VTOC). REVIEW can format tape labels, and of course, SMF records. By looking in the REVIEW documentation we've just mentioned, you can learn about many of the different kinds of records which REVIEW is able to format. I believe that REVIEW has a general formatting capability too, if you feed it a DSECT, but I have never used that capability myself. The main idea here is that you should spend some time exploring this beautiful command that has some 30000 lines of source code, supporting many features which can be very useful in your work. You can browse ASCII data with REVIEW by issuing the ASCII subcommand, which will convert the ASCII data to EBCDIC and display it on your screen. REVIEW commands toggle. So if you issue ASCII once, you'll get ASCII ON. Issue the ASCII command again, and you'll get ASCII OFF. Examples of other REVIEW commands which toggle, are SMF (to format SMF records you're browsing) and HEX (to display your data in HEX or character format). Several REVIEW subcommands facilitate the copying of data from files that you're REVIEWing. These are the CUT and ADD subcommands. They work as follows. First, you allocate an appropriate output dataset to the SYSUT2 ddname. This dataset is for receiving the copied files. Then you position the screen to the place where you want to start the copy operation. Then you issue a CUT or ADD subcommand, to copy either a number of lines (which you specify), or to go to end-of-file, which is the default if you don't specify a number of lines. The difference between the CUT and ADD subcommands of REVIEW is that ADD will append additional data to the end of an already opened SYSUT2 file, whereas CUT will close the SYSUT2 file after the copy operation is complete. You can do the allocation of the SYSUT2 file from within REVIEW by issuing a TSO subcommand, followed by the appropriate ALLOC command and its parameters. A particularly useful application of the CUT and ADD subcommands of REVIEW is to look at a SYSLOG on disk, and do a FIND ALL for a job name or another character string. After a FIND 'string' ALL command, REVIEW will only display the lines of data where the string is found. So after a FIND ALL for a particular job number, if you issue a CUT or ADD command, you'll copy the job history data for that particular job, out to a file, and you can print or save the file, to show the "evidence" to the Operations people or the Application programmers. As I said before, I've only scratched the surface in mentioning things which REVIEW can do. If you invest some time exploring REVIEW's many features, you will discover a multi-faceted tool for data examination which will help you to debug your programs, look at all kinds of system data, and help the application programmers with their problems also. REVIEW can look at tape data and disk data, and once you've gotten familiar with it, you'll see that REVIEW will function as "a second pair of eyes" to look at much of your computer data. Best of luck to all of you. I hope to see you again next month!