TV (Tape to VSAM)

Purpose
Copy tape records to a VSAM data set.
Usage notes
Use this function to copy all or selected tape records to a VSAM data set. You can also use this function to convert a multiple file tape into a single VSAM ESDS (tape image file), which can be distributed across a network. For more information, see Copying tape data across a network.

Specify a number of files other than one, but no tape file ID or start position. Z Data Tools converts tape marks into special records containing “FILEMTMFILEMTM…”. When restoring the file to tape using the VT (VSAM to Tape) function, Z Data Tools 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 record format and the record length of the input data, and the position of the first record to copy. You can also specify the number of records to be copied, and whether any existing records in the output data set are to be replaced.
Related functions
DSC
Copy a data set to another one
TS
Copy tape data to a data set
VT
Copy a VSAM data set to tape
Read syntax diagramSkip visual syntax diagram
Syntax

                                    .-RECFMIN=U-------.   
>>-TV--+-----------+--INPUT=ddname--+-----------------+--------->
       '-LABEL=BLP-'                '-RECFMIN=recfmin-'   

                        .-POSITION=0----.  .-NLRECS=ALL----.   
>--+-----------------+--+---------------+--+---------------+---->
   '-RECSIZE=recsize-'  '-POSITION=skip-'  '-NLRECS=nlrecs-'   

   .-NFILES=1------.  .-OUTPUT=VSAMOUT-.  .-REUSE=NO----.   
>--+---------------+--+----------------+--+-------------+------><
   '-NFILES=nfiles-'  +-OUTPUT=ddname--+  '-REUSE=reuse-'   
                      '-DSNOUT=dsname--'                    

ddname
Refers to a DD or TSO ALLOC statement. The default is VSAMOUT for output.
dsname
Name of a VSAM data set.
LABEL=BLP
Specifies that bypass label processing is used. This parameter must be specified with the first Z Data Tools function that uses the tape. For BLP processing requirements, see “Customizing the Security Environment” in the Z Data Tools Customization Guide.
nfiles
Number of tape files to be copied. The maximum is 99 999; the default is 1.
EOV
Copies files until a double tape mark or an EOV label is reached.
EOD
Copies files until the delimiter specified in the EOD parameter of the SET function is reached.

Use this parameter to copy a multifile tape, including tape marks, to a single VSAM entry-sequenced data set. (You can use the VT function to copy the VSAM file back to tape, including the tape marks.) For more information, see Copying tape data across a network.

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.
recfmin
Record format for the input. 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.
recsize
Length of the input records, if recfmin is F or FB. If recfmin is F, the length of the first record is used by default. If recfmin is FB, recsize is required.
reuse
Specify YES to replace any existing records in the output data set (if it is defined with the REUSE parameter in the catalog). Specify NO to add new records without deleting the old records. The default is NO.
skip
Number of logical records to be skipped. The default is 0.
/* REXX */
/* copy a tape file to a vsam data set       */
/* allocate input tape                       */
/* use SL processing.  required file is at   */
/* position 1                                */

"ALLOC FILE(TAPE) DA('HFMUSER.TAPEIN')",
      "VOLUME(FMO001) UNIT(CART) LABEL(SL)",
      "POSITION(1) OLD"

/* copy a tape file to a vsam data set       */

"HFMMAIN $TV INPUT=TAPE,",
            "DSNOUT=VSAM.DISK.VT55.DATA"

/* free the tape unit                        */

"FREE FILE(TAPE)"

return