Working with VSE/VSAM Virtual Tapes

To work with VSE/VSAM virtual tapes, you must first define the VSE/VSAM ESDS file, which is to contain the virtual tape. This can be done via either the:
  • Dialog Define a New File (Fast Path 222).
  • VSE/VSAM IDCAMS job stream provided in skeleton SKVTAPE, which is available in VSE/ICCF library 59.

You can then use the JCL command VTAPE to open the VSE/VSAM file as a virtual tape. It can be accessed with the cuu specified. For example:

 VTAPE START,UNIT=cuu,LOC=VSAM,FILE='vsamfilename',SCRATCH

In the example, the SCRATCH parameter is optional and causes the virtual tape to be cleared before new data is written to it.

The Virtual Tape Data Handler requires DLBL label information for vsamfilename, to open the VSAM file. This must be supplied as either:
  • System standard label, to be available to all partitions. See Figure 1.
  • User label in the job from which the VTAPE START command is issued. In this case VTAPE START command processing communicates the required label information to the Virtual Tape Data Handler partition.
VTAPE STOP,UNIT=cuu closes the virtual tape file and drops the association between the tape unit cuu and the virtual tape file. If this was the only active virtual tape, the Virtual Tape Data Handler is stopped after 30 seconds.