MVS TOOLS AND TRICKS OF THE TRADE JULY 2006 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 WORLD SHOULD BE FULL OF COLLECTORS - 2 As a longtime MVS systems programmer, a large part of my arsenal of tools consists of my tape collections, my JCL collections, and whatever source code examples, especially in Assembler language, that I've been able to keep nearby. Nevertheless, no matter how avid a collector that anyone is, everyone knows that a big pile of tapes in the closet has much POTENTIAL value, but its actual value varies. If you don't know what is IN the collection, you might have all the gold in the world there, but you won't be able to use it. My experience tells me that it still pays to save all those tapes, because you (or someone else) might be able to make good use of them LATER, and I absolutely advocate NOT throwing them out. But there's an even better idea. If you can use these tapes NOW, that's much better than only potentially being able to use them later. It takes only a little work to make all your tapes and JCL searchable. You can even make all of your PTF tapes searchable. The idea is something like organizing a filing cabinet. Not everybody does it, but once you do, it's relatively easy to find most of the things that are in there. The tools that it takes are things that not so many MVS sysprogs use on a very regular basis, even if they do know about them. I have found that a certain combination of these tools can be used to create indexing pds'es, which can then be searched very easily, using the FIND "pds multiple member" string searching capability of the free PDS program package. And once everything has been set up, you can quickly find almost any software materials or PTFs that are on any of the tapes in your tape closet. If you need something quickly, you will pick the exact tape and files that are needed, and load them (and only them) onto disk. If you can't already do this, the way you are set up now, doesn't the prospect sound exciting to you? Actually, with only a moderate amount of attention, it's quite easy to accomplish. PRODUCING PDS MEMBERS CONTAINING THE TAPE REPORTS You can't find out anything about what's on a tape unless you read the tape on a tape drive. I am one of those people who don't trust the paper label that is stuck on the tape, to tell me completely what that tape contains. I have better tools, and if I can use them by reading the tape on a tape drive to discover its real contents, then I don't completely trust what's on the paper tape label to help me find the data that I need. In order to read a tape in a manner that is appropriate for my searching purposes, that is, to find out member names that are on IEBCOPY or IEBUPDTE backed-up pds files, or to find out the dataset names of the tape files, or to find the DASD dataset names backed up by an FDR tape, or to find out PTF particulars (such as which FMID the PTFs belong to) on a tape containing PTFs, we must use an appropriate tape searching program. Such searching programs exist, and (for the most part), they are free. To obtain these programs, do a www.google.com search for "CBT Tape" to get to the free CBT Tape website, and from there (you don't need to be a "member of anything" or know any password) you can download all of these MVS tools, and install them on your MVS system. These are free and public programs, and in my extensive experience with them, they are "very tried" and "very true". What are the appropriate programs to use? For starters, I always use the TAPEMAP program from CBT File 299. TAPEMAP will show you, not only the sequence number and name of all files on the tape, and their physical file characteristics, but for many types of tape backup files, such as IEBCOPY or IEBUPDTE, TAPEMAP will show you (in its second report) all the backed-up member names, or for PTF files, TAPEMAP will show you the PTF numbers too. For FDR backup tapes, TAPEMAP will list all the DASD file names that were backed up to that tape by FDR or FDRDSF. For PTF files in particular, I use the two programs from CBT File 118 called PUTXREF and SMPUPD to read the tape. PUTXREF produces a report showing which FMIDs each PTF, APAR, FUNCTION, or USERMOD belongs to. And the outputs of the PUTXREF program come in several very useful formats that are appropriate for further processing. (These support FORFMID-like preprocessing of PTFs without directly using SMP/E.) The SMPUPD program, whose primary purpose is to break up an SMPPTFIN-format file into a pds containing individual PTFs, can also be used (with PARM=READ) to produce an informative report about the individual PTFs that the SMPPTFIN-format file contains. See Figure 2 for an illustration of both of these programs. If you know that the tape contains a DFDSS backup file, then the appropriate tape-reading program will have to be ADRDSSU (the DFDSSdss program) itself. The COPYMODS program from CBT File 229, using its PARM=READ capability, has (besides its many other strengths) the almost unique capability of automatically reporting on, and bypassing all leading tape marks on a tape (even 200 or more of them), and telling you what else is there, after all the tape marks. In any case, whatever tape-reading tool you do use, the idea is that the tape report has to contain tell-tale search strings which will help you find your data. These might consist either of dataset names, and/or pds member names or PTF names which will occur in the backed-up data. I then use the SDSF "PRINT OUTDSN" command, or whatever command for copying the report data is appropriate to your spool browsing program, to copy the tape report into a member of an appropriately constructed pds. For images of printed reports, I prefer pds'es that are Fixed Blocked with an LRECL of 133; these usually have enough room to contain all of the printed data. SEARCHING PDS'ES FOR MEMBERS CONTAINING A STRING Once these tape reports have been produced, and they have been loaded into members of either FB-80 or FB-133 pds'es, then, I must locate the search strings I want to find, in the pds members which contain them. That information will tell me on which tape, and on which file of that tape, I can find the data I want. For this search, across multiple pds members in a pds, I use the PDS program package from CBT File 182 (load modules are on CBT File 035 or 135, and you can copy the ISPF panels and messages from File 182 for a quick install, if you don't want to assemble the PDS program yourself). The PDS program contains a pds multiple-member-oriented string finding subcommand, called FIND, which you can run against any pds member subgroup, and produce the output either as an ISPF member list under PDS, called a MEMLIST, or as a member subgroup (called a SUBLIST) which is defined by the PDS program itself. (Or you can display the actual records within each member, containing the strings themselves.) Searching the smaller list of members that contain the desired string, is (of course) easier than to search the entire pds, which might have a very large number of members, most of which are not relevant to what you want to look for. Of course, to search a JCL pds for execution JCL that I want to find, I can also use this same FIND subcommand of the free PDS program package. Suppose (for example) that I am having some problems running a DFDSS move of some datasets from one DASD volume to another, and I want to find some JCL in my (large) JCL pds which has already been proven to do this properly. I'll point the PDS program to the JCL pds, do an FIND on some string like "PGM=ADRDSSU" using the FIND subcommand of the PDS program, and come up with a subset of pds members which contain the string PGM=ADRDSSU and which most likely are DFDSS JCL examples. The complete PDS subcommand string would be: FIND : /PGM=ADRDSSU/ THEN(MEMLIST) or THEN(SUBLIST) The colon (:) in the command, means to search ALL of the pds members. To search a previously created subset of members, you would use an asterisk (*) instead of the colon. And this would yield a subset of (the original group of) pds members which contains the desired search string. It's much easier to look at this small subset of members, than to search the entire pds for what I want. This technique is the key to all of our efforts, whether the search is against a JCL pds, or it is against the tape indexing pds that we have constructed. WHAT A TAPE COLLECTION PDS LOOKS LIKE Suppose I have 60 tapes that I want to index in this way. I would run 60 TAPEMAP jobs against these 60 tapes, or one job against all of them, if I can somehow keep the individual output reports separated from each other. Then each of the TAPEMAP reports could be written to one member of the TAPEMAP.OUTPUTS pds which is FB-133, preferably with the volser of the tape being a part of the member name in the pds. Since the TAPEMAP program produces two reports, the SYSPRINT report containing the physical characteristics of the tape files, and the SYSPRNT2 report which holds the member names of pds members, or PTF numbers, or FDR backup data, I might want to make separate members of the pds with data from each of these reports separately, as members TAPVOLA and TAPVOLB, respectively. Either way I do it, the PDS program product's FIND capability will easily be able to locate any of the information I want to look for. See Figure 1 for a JCL example of such a TAPEMAP job. I have to mention, that if you are in possession of one or more physical CBT tapes, the TAPEMAP program can expand each of the files, which are in "CBT973-compressed format", and display all the member names, and all the IEBUPDTE-embedded member names in all the files. So if you TAPEMAP a genuine CBT tape, you'll be able to find all the member names for almost all the files, in the SYSPRNT2 TAPEMAP report. Now, searching the TAPEMAP.OUTPUTS pds using the PDS program's FIND subcommand, as we mentioned before, is a snap. You can locate any member name or program name or dataset name that was backed up on the tape. SPECIAL PROCESSING FOR PTF TAPES In my opinion, the PTF tapes that your shop has, deserve special treatment. The reason for this is, that even though you may do regularly scheduled SMP/E processing for all your PUT tapes or CBPDO tapes or whatever, you may need, at some future point, to find or examine a PTF that has not ever been RECEIVEd, or has not ever gotten onto your system. Often the PTF tapes you get will also include later versions of a PTF, designed for a level of z/OS that you haven't put on yet. You might have a need to examine this PTF without putting it on the system at all. And you'll first need to find out if you already have it in the shop. Granted, with the speed of electronic PTF ordering that we have nowadays, this is not as important an endeavor as in "former times", when we had to wait for a PTF to arrive on a tape in the mail. But still, it's nice to know that you already have a PTF on a tape which is in house, and you can look at it quickly, without any additional fuss or special ordering from IBM. What kind of processing do we have to do, to get this done? We can use the PUTXREF program from CBT File 118. Since our space is somewhat limited here, I have shown most of the functionality of PUTXREF in Figure 2. The three outputs of PUTXREF are the PRINTER, SMPCOUT, and PDSATOUT DD names. PRINTER is a SYSOUT file that should be copied into an FB-133 pds and searched later. SMPCOUT and PDSATOUT can already be automatically loaded into pds'es by the job itself, and of course, these pds'es can also be searched later for the FMID number or the PTF number. SUMMARY Rather than let your MVS tape library remain as a big pile of tapes in your tape closet, why not "index" the tapes and make their contents searchable? The free PDS program package from CBT File 182 allows you to search multiple members of a pds for a string and report on only those members which contain the search string. So it makes sense to read all your tapes on a tape drive with an appropriate tape mapping program, and copy the reports to a pds, which can then be searched afterwards for a program name, a PTF number, or an FMID. This will make the software you're looking for, findable in a jiffy, and you'll know which tape it's on, and exactly which file also. I trust that this information will be helpful to many of you. I'm looking forward to seeing you here again next month, and I wish all of you the best of everything. * * * * * * * * * * * * * * * * * * * * * * * Figure 1. JCL to run the TAPEMAP utility against multiple tape volumes in one job. //SBGOLOBM JOB (ACCT#),'TAPEMAP UTILITY', // NOTIFY=&SYSUID, // CLASS=B,MSGCLASS=X //*------------------------------------*// //* TAPEMAP UTILITY PROGRAM *// //* CBT TAPE FILE 299 *// //*------------------------------------*// //TAPEMAP PROC VL=XXXXXX //TAPEMAP EXEC PGM=TAPEMAP //STEPLIB DD DISP=SHR,DSN=your.loadlib //SYSUT1 DD DISP=OLD, // UNIT=CART, // VOL=(,RETAIN,SER=&VL), // LABEL=(,BLP,EXPDT=98000) //SYSPRINT DD SYSOUT=* //SYSPRNT2 DD SYSOUT=* // PEND //* //S01 EXEC TAPEMAP,VL=EXS001 //S02 EXEC TAPEMAP,VL=EXS002 //S03 EXEC TAPEMAP,VL=EXS003 //S04 EXEC TAPEMAP,VL=EXS004 //S05 EXEC TAPEMAP,VL=EXS005 //S06 .... * * * * * * * * * * * * * * * * * * * * * * * Figure 2: JCL and Sample Outputs from the PUTXREF and SMPUPD programs - CBT File 118 PRINTER output of PUTXREF shows which SYSMODs belong to which FMIDs. These can later be searched by PTF number using the PDS command FIND subcommand. PUTXREF SMPCOUT output can be fed into an SMP/E APPLY SELECT job to achieve a FORFMID effect. PUTXREF PDSATOUT output can be fed into the PDS command package, to add ISPF stats to your SMPPTS members showing their FMID. SMPUPD SYSPRINT output shows the number of records in each PTF, and how many internal ./ cards each PTF has. //youruidF JOB (A006,SYTM,99,99),S-GOLOB, // CLASS=B,MSGCLASS=X,NOTIFY=&SYSUID //* //********************************************// //* PUTXREF PROGRAM FROM CBT FILE 118 *// //********************************************// //* //S01XREF EXEC PGM=PUTXREF,REGION=4096K //STEPLIB DD DISP=SHR,DSN=your.loadlib //INPUT DD DISP=SHR,DSN=youruid.OA06712.SERVICE <-SMPPTFIN file //SORTIN DD DSN=&&SORT,DISP=(NEW,PASS),UNIT=SYSALLDA, // DCB=(RECFM=FB,LRECL=15,BLKSIZE=4095), // SPACE=(CYL,(150,40)) //SORTOUT DD DSN=&&SORT,DISP=(SHR,PASS),VOL=REF=*.SORTIN //TITLES DD DISP=SHR,DSN=CBT.CBT471.FILE118.PDS(TITLES) //PRINTER DD SYSOUT=* //PDSATOUT DD DISP=SHR,DSN=youruid.PTFPDS(OA06712A) //SMPCOUT DD DISP=SHR,DSN=youruid.PTFPDS2(OA06712) //SYSUDUMP DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * SORT FIELDS=(9,7,CH,A,1,7,CH,A) /* - - - - - - - - - - - - - - - - - - - - - - - - - Sample PRINTER output from PUTXREF (FB-133 - squeezed to fit in here) SYSMOD BY FMID CROSS REFERENCE PAGE 1 FMID SYSMOD SYSMOD SYSMOD SYSMOD SYSMOD SYSMOD SYSMOD SYSMOD ******* ******* ******* ******* ******* ******* ******* ******* ******* HBB7707 (title - if found - goes here) UA03994 UA06335 UA06381 UA11443 UA12189 UA12204 UA12312 UA12688 UA15173 UA15759 UA16071 UA16226 UA16709 UA16718 UA17276 UA12786 - - - - - - - - - - - - - - - - - - - - - - - - - Sample SMPCOUT output from PUTXREF ./ ADD NAME=HBB7707 UA03994 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA06335 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA06381 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA11443 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA12189 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA12204 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA12312 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ UA12688 /* FMID - HBB7707 - FROM PUT TAPE - DONE 04/02/06 */ - - - - - - - - - - - - - - - - - - - - - - - - - Sample PDSATOUT output from PUTXREF ATTRIB UA03994 ADDSTATS ID(HBB7707) ATTRIB UA06335 ADDSTATS ID(HBB7707) ATTRIB UA06381 ADDSTATS ID(HBB7707) ATTRIB UA11443 ADDSTATS ID(HBB7707) ATTRIB UA12189 ADDSTATS ID(HBB7707) ATTRIB UA12204 ADDSTATS ID(HBB7707) ATTRIB UA12312 ADDSTATS ID(HBB7707) ATTRIB UA12688 ADDSTATS ID(HBB7707) - - - - - - - - - - - - - - - - - - - - - - - - - Sample SMPUPD SYSPRINT output (squeezed from FB-133 size) SMPUPD - ADD PDSLOAD (IEBUPDTE) CARDS TO AN SMPPTFIN FILE - READ ONLY ... PTF UA10754 HAS 1,397 RECORDS WITH 0 INTERNAL ./ RECORDS CHANGED TO >< PTF UA13586 HAS 1,445 RECORDS WITH 0 INTERNAL ./ RECORDS CHANGED TO >< PTF UA11460 HAS 2,825 RECORDS WITH 0 INTERNAL ./ RECORDS CHANGED TO >< PTF UA18918 HAS 4,610 RECORDS WITH 0 INTERNAL ./ RECORDS CHANGED TO >< PTF UA18786 HAS 123,489 RECORDS WITH 0 INTERNAL ./ RECORDS CHANGED TO ><