VSE/VSAM ESDS File Definition (Skeleton SKVTAPE)

Skeleton SKVTAPE creates a VSE/VSAM ESDS file that is to contain a virtual tape. Figure 1 shows the skeleton.

Figure 1. Skeleton SKVTAPE
* $$ JOB JNM=SKVTAPE,CLASS=0,DISP=D
// JOB SKVTAPE     CREATE VIRTUAL TAPE FILE
// EXEC IDCAMS,SIZE=AUTO                                               
   DELETE (VSE.VTAPE.FILE) PURGE CL -                                  
          CATALOG(VSESP.USER.CATALOG)                                  
   DEFINE CLUSTER (NAME(VSE.VTAPE.FILE) -                              
          RECORDS (1000 1000) -                                        
          TO (99366) -                                                 
          REUSE -                                                      
          NONINDEXED -                                                 
          SHAREOPTIONS (1) -                                           
          SPANNED -                                              
          RECORDSIZE (32758 32758) -                                   
          CISZ (32768) -                                               
          VOLUMES (-V001-)) -                                          
          DATA (NAME(VSE.VTAPE.FILE.@D@)) -                            
          CATALOG (VSESP.USER.CATALOG)                                 
    IF LASTCC NE 0 THEN CANCEL JOB                                     
/*                                                                     
// OPTION STDLABEL=DELETE
VTAPE1
/*
// OPTION STDLABEL=ADD
// DLBL VTAPE1,'VSE.VTAPE.FILE',99/366,VSAM,CAT=VSESPUC
/*
// EXEC IESVCLUP,SIZE=AUTO             ADD LABEL TO STDLABUP PROC
D                                              VTAPE1
A VSE.VTAPE.FILE                               VTAPE1  VSESPUC
/*
/&
* $$ EOJ       
Explanations to skeleton SKVTAPE:
-V001-
This variable defines the volume on which the VSE/VSAM virtual tape file is located. The VSAM space is part of the VSE/VSAM user catalog VSESPUC (VSESP.USER.CATALOG).
RECORDS
The number of RECORDS depends on the amount of data the virtual tape is to contain. The definition provided in SKVTAPE results in a file size of about 32 MB. If this size does not meet your requirements, modify the definitions in SKVTAPE accordingly.
REUSE
REUSE allows repeated writing to a virtual tape from the beginning. When specifying the SCRATCH parameter in the VTAPE START command, the tape is cleared before new data is written to it. Without the SCRATCH parameter, existing data is overwritten. Refer also to Writing to VSE/VSAM Virtual Tapes.

NOREUSE is for creating a new and empty file for writing data to it once; for backup, for example. NOREUSE together with SCRATCH is invalid and causes an error message.

SHAREOPTIONS
SHAREOPTIONS (1) allows multiple READ operations or one WRITE operation to be active. It is recommended not to change the setting of the share option. Refer to File Sharing for further details.
RECORDSIZE
The value for the RECORDSIZE parameter is the CISZ value minus 10 bytes (CISZ minus 20 bytes in case of a compressed cluster).
CISZ
The recommended value for the Control Interval Size is 32 KB; it should not be smaller than 8 KB.