VT (VSAM to Tape)

Purpose
Copy VSAM records to a tape file.
Usage notes
If you used the TV (Tape to VSAM) function to copy a multifile tape to a single VSAM ESDS (tape image file), you can use VT to copy the file back to tape. File Manager converts the special records back into tape marks. The resulting tape is an exact copy of the original tape.

Specify a DDNAME for the tape.

Options
You can specify the number of records to skip from the beginning of the input data set, or the key or slot value to start processing. You can also specify the output record format and block size.
Related functions
DSC
Copy a data set to another one
TV
Copy tape data to a VSAM data set
VO
Copy VSAM data to an object database
Figure 1. Syntax

1 VT
1! INPUT=VSAMIN
1 INPUT=ddname
1 DSNIN=dsname
1! POSITION=0
1 POSITION=skip
1 KEY=key
1! NLRECS=ALL
1 NLRECS=nlrecs
4? LABEL=BLP
4 OUTPUT=ddname
4? DENS=mm
1! RECFMOUT=U
1 RECFMOUT=recfmout
5? BLKSIZE=blksize
blksize
If recfmout contains F, the actual block size; otherwise, the maximum block size. If recfmout contains B or S, blksize is required; otherwise, it is optional. The maximum is 65 535 (for V), 9 999 (for D), or 9 999 999 (otherwise). If the tape is processed by other utilities or standard access methods, you must also consider the operating system limits.
ddname
Refers to a DD or TSO ALLOC statement. The default is VSAMIN for input. To create the output tape file with standard labels, specify AL or SL processing on the DD or TSO ALLOC statement.
dsname
Name of a VSAM data set.
key
A key for KSDS records, or a slot number for RRDS records. The maximum key length is 30 characters. The first record with a key or slot value greater than or equal to key is the first record copied. If you omit the key and skip values, copying begins with the first record in the data set.

If the key contains lowercase characters, blanks, or commas, enclose it in quotation marks. You can also specify a key in hexadecimal format (for example, X'C1C2C3').

LABEL=BLP
Specifies that bypass label processing is used. This parameter must be specified with the first File Manager function that uses the tape. For BLP processing requirements, see “Customizing the Security Environment” in the File Manager for z/OS® Customization Guide.
mm
A 2-byte tape mode as shown in Tape density and mode values.
nlrecs
Number of records to be copied or ALL. The maximum number is 99 999 999. If you specify ALL or omit the parameter, all the remaining records are copied.
recfmout
Record format for the output. Each value is a combination of the following letters:
B
Blocked
D
Variable-length ISO/ANSI tape records
F
Fixed length
S
Spanned format
U
Undefined length
V
Variable length
The possible values are: U, F, FB, V, VB, VBS, VS, D, DB, DBS, and DS.
skip
Number of logical records to be skipped from the beginning of the data set. If you omit the skip and key values, copying begins with the first record in the data set.
//VT  JOB (acct),'name'  VSAM to TAPE
//FMBAT    PROC
//FMBAT    EXEC PGM=FILEMGR
//STEPLIB  DD DSN=FMN.SFMNMOD1,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//         PEND
//*
//IDCPROC  PROC
//IDCAMS   EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//         PEND
//*
//CREATE   EXEC IDCPROC,REGION=6M
//SYSIN    DD *
 DELETE FMNUSER.VSAM.VT55 CLUSTER PURGE ERASE
 DEFINE CLUSTER ( -
      NAME( FMNUSER.VSAM.VT55 ) -
      CISZ(4096) -
      FREESPACE(30 30) -
      NONINDEXED -
      KEYS(12 0) -
      RECORDS(1000 100) -
      RECORDSIZE(133 133) -
      REUSE -
      VOL(MVS1W2) ) -
    DATA( NAME(FMNUSER.VSAM.VT55.DATA) )
/*
//*
//STP1005  EXEC FMBAT
//VSAMIN   DD DISP=SHR,DSN=FMNUSER.VSAM.VT55
//TAPE     DD UNIT=CART,
//            VOL=(,RETAIN,,,SER=FMO001),
//            LABEL=(1,SL),DISP=(,KEEP),
//            DSN=FMNUSER.TAPEOUT
//SYSIN    DD *
$$FILEM VER
*           GENERATE SOME DATA AND PLACE
*           IN A VSAM FILE
$$FILEM DSG OUTPUT=VSAMIN,REUSE=NO,NLRECS=4000,
$$FILEM     RECSIZE=133,FILLCHAR=BIN,KEYLOC=1
*           NOW COPY THE VSAM FILE TO TAPE
$$FILEM VT  INPUT=VSAMIN,OUTPUT=TAPE
$$FILEM EOJ
/*