My Tape Mount Automation Solution (V3)
Purpose
This utility set was designed to fully automate all tape mounts on my MVS3.8J system running under the hercules emulator, and it does that.
It maintains a catalog of scratch/in-use tapes that is used to automate mounts for both named tape volsers and scratch tape mount requests. As well as the core TAPEMAN program for message triggered tape mount automation there is a set of utility programs for database management.
You will need to enable the DIAG8 command in your hercules configuration file
to use this. So if you don't want to do that you should read no further.
Although in the later released of hercules the diag8 can be enabled while
still preventing shell access I don't see this as an issue myself.
As shipped the DIAG8 interface is expected to be interfaced to via the MDDIAG8
program also available as source from this site,
alternately you can obtain the binary only HERCCMD program written by Grzes Plucinski
and change all referenced to MDDIAG8 to HERCCMD.
Refer to the herccmd document
on how to obtain that.
You will also need my date/time utility library also available on this site to assemble some of the programs.
Credits
- The assembler used to access VSAM files is shamelessly based upon code from the hercules documentation of Jay Moseley, which I admit I don't fully understand so is a lot of cut/paste from his supplied code is in the programs used by tapeman
The TAPEMAN3 program itself
Basically once installed one of the following will happen for every tape mount request
- for a scratch tape mount request will locate a scratch tape from its database
and do a devinit for the tape on the correct tape unit.
smarts:if there are no remaining scratch tapes in the database it will WTOR to the console asking for a tape volser to be provided, so you can select an existing tape to overwrite or create a new one (and add it to the tapeman database) and use that, or reply cancel to the wtor which will cancel the batch job
note: for Version 3 running under MMPF this pauses MMPF automation also as MMPF will suspend waiting for the WTOR response; my desired result as if in the middle of a batch run I don't want any more mounts processed until the issue is sorted - for a named volser tape mount that is a local tape (in the tapeman database)
it will issue the devinit command
to mount the tape on the correct unit, write or read requests handled
smarts:named tapes not in the tapeman database will not be automatically mounted, to avoid eternal looping on a non-existent aws file; instead the origional NRD will be DOM'ed [if LNK or CMK rukes are used in MMPF] (to avoid automation looping on the mount) and TAPEMAN3 will generate a new NRD saying basically "not automated, manually mount VOLSER on CUU" just so the mount request doesn't get lost.
Additional core batch programs
The other key programs provided are to do with management of the tape catalog file, or to fullfull a need I found. Note that for Version 3 running under MMPF when any manual maintenance is needed to be done by these utilities that MMPF needs to be stopped, as MMPF locks the database.
- TAPEMSCR - should be run daily from your scheduler. Scans the database and returns any tapes that have expired to the scratch pool.
- TAPEMUTL - used to add, delete, list and manually scratch entries from the tape catalog
- TAPEMEXP - mainly used for testing expiry processing, will allow you to change the expiry date on tape volume entries in the tape catalog.
- TAPEMCUU - mount a tape (scratch or named) on device CUU in about 10 seconds,
the batch job invoking it (invoked via a supplied proc to background tapemcuu via intrdr)
is expected to ask for a tape mount specifically on device CUU
in the next step before the backgrounded mount is actioned
so it will get the tape it expects after it is asked for it (if it is mounted early it gets unloaded
when the batch job asks for it)). Example jobs showing its use are provided
Why?. Back when I still used IEECVXIT for message automation it needed to schedule SRBs under started tasks to automate the mounts, but started tasks had locks on files I was trying to backup so a deadlock. This solution is designed for the shutdown everything but JES2 scenario, and still allow tape mounts to be automated solely by the batch jobs themselves when all message automation is turned off (but automation had better be turned off before using this).
The database
This will probably be the most complex part of the installation.
Basically you need a VSAM database, as a general rule most users don't allocate
a lot of vsam space when initialising dasd, I certainly wasn't doing so.
The installation instructions therfore cover in detail creating a dasd volume
dedicated to vsam datasets; so if followed you shouldn't have any problems.
And as a bonus
There are a couple of extra utilities to assist with performing backups and keeping track of what is backed up onto what tape available on my website. The latest copies are currently bundled in the BKBYVTOC utility and will perform the following functions
- bkbyvtoc itself takes a list of DASD volsers, reads the vtocs on them and generates the JCL required to backup all the files on the DASD volumes and submits the job(s) plus creates a report file of all the datasets backed up by the job; including source volser, dataset lrecl, blocksize, structure etc. that you need if you ever want to restore a file.
- mdexwrap is (optionally) used by the generates JCL to wrap around calls to IEBCOPY and IEBGENER, this allows it to at the end of each step record the tape volser used and actual output filename along with simiular info generated by bkbyvtoc. I use this as under mvs38j the tape volser used is not available until the file open is requested and satisfied, so after the iebgener/iebcopy completes it can obtain and record the information in a format similar to that generated by bkbyvtoc so there is a record of what is on each named tape volser, as opposed to the bkbyvtoc listing which is what it intends to write to an unknown tape. (the optionally is because you don't need to use this in the bkbyvtoc job templates, you could just use iebcopy or iebgener if you don't care what is on a tape)
TAPEMAN3 download
If you have read this far, you probably want to download and try this toolkit. So for your enjoyment
Version 3
Version 3 cannot be triggered from IEECVXIT, it requires my MMPF utility.
Additionally I would recomend installing my usermod
ZMD0001
for TK4- systems as it
handles RAKF denies on tape mounts and manages enqueues on the tape database. The version linkes to here is most likely
more up-to-date than the one bundles in the install deck. A sample TK3 IEECVXIT is also provided
in the install deck.
Installing tapeman version 3 is a simple case of
- download the TAPEMAN Version 3.06 install jcl, globally change the file prefixes as documented at the start of the JCL deck to prefixes suitable for your system, and run it; as well as creating all the install files and assembling the modules all the manuall customisation steps needed after that are fully documented in the <pref>.TAPEMAN3.DOC file, member $INSTALL.
- In summary these are
- Customise the supplied createdb job for your site prefixes, and run it to create the vsam database
- customise target filenames in the two provided jobs to copy the needed modules from that program library to an APF authorised and non APF authorised library respectively
- Add an additional DD card to the MMPF proc for the tape database, and adding four message rules to the MMPF parm member. And F MMPF,MMPF=nn to activate the new rules.
- You should also review the sample user exit IEECVXIT(TK3) or usermod ZMD0001(TK4-) in the SRC dataset, and customise your user exit as appropriate. Note that the version of ZMD0001 linked to above is likely to be more up-to-date that the one bundled in this install deck.
- Thats it, your tape mounts are automated... if you installed my MDDIAG8 or the alternate HERCCMD program.
A seperate utility I have not yet bundled into the main file is DEVITAPE you may also want. That program will issue a devinit to mount a tape so you can get hercules to mount tapes using the MVS console.
However if you do not wish to use my MMPF tool, then you may be interested in Version 1 below, which can be run with IEECVXIT customisations.
Version 1-2 (obsoleted)
Version 1(2) is useable either via the IEECVXIT user exit or by my MMPF console automation toolkit. This is now a static release, future versions of TAPEMAN will not be able to be used from IEECVXIT. Here is the JCL to unload the AWS tape and the download>the AWS tape file itself.
Once you have run the JCL to unload the .AWS tape file the installation
documentation is included in the <pref>.TAPEMAN.DOC file, member $INSTALL.
The DOC file also has the instructions on how to customise IEECVXIT and use the utility programs.
While the earlier versions work all (and I have many planned) enhancements will only be into Version 3 or later. You use the earlier versions at your own risk.
On the TODO listi for V3
To create a history log of tapemounts (volser, jobname, date)
so I can more easily find what backups are on what tape
(yes, I have needed to do restores); as the tapeman3 restamp
of access date to a tape in the database can confuse things if only using the
tapeman3 tape catalog to find which tapes are being used.
Status update: done, completed, working. Not only that a PHP webpage can be used
to manage the restores by selecting a file and backup date. However I have
bundled them as "additional utilities" on the
backup by vtoc utility
page as they are designed to work in conjunction with that utility.