Vse Virtual Tape Support
Vse Virtual Tape Support
In general, the Virtual Tape Support included in VSE is intended to be transparent to applications
and to provide the customer with the ability to read from or write to a virtual tape in the same way
as if it were a physical tape. For technical and performance reasons, the full range of the
capabilities of a physical tape has not been implemented.
Before you use the VSE Virtual Tape Support, please check for PTFs related to your particular
VSE release. Refer to the VSE Homepage for more information.
Storage Requirement
The I/O Supervisor allocates a 1MB buffer for each Virtual Tape in the System-Getvis area of your
VSE system. The buffer space is taken preferred out of the System-Getvis 31 area and PFIXed. It is
used to buffer the tape data before writing/reading them to/from the Virtual Tape. So before using
the "VTAPE START" command make sure that enough PFIXed space is available in the System-
Getvis area of your VSE system.
If the system is short on PFIXed System Getvis storage message 1YN1t (Tape simulator
encountered internal error) is displayed in response to the "VTAPE START" command.
You can check the free PFIXed System-Getvis space of your VSE system by issuing the AR
command "MAP SVA".
Following are some recommendations how to specify the parameters for the definition of a VSAM
virtual tape file:
This is also true for a multiple z/VSE system environment. Multiple write access to a single Virtual
Tape will cause unpredictable results. Therefore use also Share Option 1 for the definition of a
VSAM tape image file in a multiple VSE system environment.
REUSE Parameter: Specify NOREUSE if you want to write once on the Virtual Tape and
only read it afterwards. Specify REUSE if you want to use the Virtual Tape as a work file.
Record and Control Interval Size: It is recommended to specify 32k for the control
interval size. Make sure that the record size is at least 10 bytes smaller than the control
interval size.
The TAPESRVR job is started with // OPTION SYSPARM='00' and will try to connect to TCP/IP
stack '00'. The problem occurs if the TCP/IP stack has been started with a different stack number,
for example '02'. Therefore no connection can be established and message 1YN1D is issued.
On the PC, the Virtual Tape Server will not show any connection or error messages at all. To solve
that problem include/adapt the // OPTION SYSPARM='nn' statement in your TAPESRVR startup.
You can use skeleton SKVTASTJ in ICCF library 51 to do so.
FILE='D:/Frank''s/Virtual Tapes/vt021401.001'
Windows, UNIX or Linux can have more than 100 characters in length. Therefore you may specify
FILE='filename' twice or even three times. The filename information is concatenated in storage,
thus allowing for a file name length of 200 or even 300. The following example is equivalent to the
one from above:
FILE='D:',FILE='/Frank''s/Virtual Tapes/',FILE='vt021401.001'
Windows usually uses back slashes to separate directories (e.g. C:\vtape\tapeiamge.aws). Back
slashes often causes EBCDIC to ASCII code page translation problems; they are translated into
some incorrect characters. Therefore we recommend using forward slashes (e.g.
C:/vtape/tapeiamge.aws) with VTAPE, even when using Windows. Forward slashes usually do not
cause codepage translation problems.
The Java runtime automatically converts forward slashes into back slashes on Windows. If back
slashes are used it can happen that the filename on Windows is treated as relative path instead of an
absolute path and the tape image is created in the Virtual Tape Server's installation directory. This
is because Windows does not recognize the path as absolute if the back slashes are translated into
some incorrect characters.
Sample jobs
The following sample job illustrates the use of VTAPE to backup a VSE library:
The following job illustrates the use of VTAPE in combination with logical units:
* $$ JOB JNM=VSAMBKUP,DISP=L,CLASS=0
// JOB VSAMBKUP
// ON $CANCEL OR $ABEND GOTO VTAPSTOP
* THIS JOB BACKS UP VSAM DATASETS
// DLBL IJSYSUC,' catalog ',,VSAM
VTAPE START,UNIT=181,LOC=ip-addr,FILE='filename on workstation',SCRATCH
// ASSGN SYS005,181
// EXEC IDCAMS,SIZE=AUTO
BACKUP ( cluster ) -
REW
NOCOMPACT -
BUFFERS(3)
/*
/. VTAPSTOP
// ASSGN SYS005,UA
VTAPE STOP,UNIT=181
/&
* $$ EOJ
Note: If you omit the ASSGN SYS005,UA, you will receive message 1YN5D TAPE 181 IS
ASSIGNED at VTAPE STOP.
In case of a remote virtual tape, the easiest way to cancel an ongoing I/O operation is to flush the
connection:
Enter
xxx FLUSH <ip-address of the remote vtape>,<port of remote vtape>
where xxx is the partition ID of the TCP/IP partition.
This causes TCP/IP for z/VSE to flush all data and terminate all connections with the specified IP
and port address. The virtual tape can no longer be used after the flush command. After the flush
command, check for any logical assignment to the virtual tape by entering the AR command:
LISTIO <cuu> where <cuu> is the physical address of your virtual tape. Issue an ASSGN,
SYSxxx,UA command for each assignment that still exits for the virtual tape. After that terminate
the virtual tape with:
VTAPE STOP,UNIT=<cuu>.
This will cause the necessary cleanup so that you should be able to restart the virtual tape with a
VTAPE START command after that.
If you want to terminate the Tape Data Handler Subsystem then close all virtual tapes with the
"VTAPE STOP" command. The Tape Data Handler will then automatically terminate after 30
seconds. To find out which tape units are defined as virtual, use the VOLUME command. After the
termination of the Tape Data Handler verify after that no virtual tapes are active any more. In case
there are still virtual tapes defined, issue a 'VTAPE STOP against the remaining virtual tapes.
In case the Tape Data Handler is canceled due to an error condition (for instance program check)
you must close all open virtual tapes to avoid inconsistencies in the system. Display the open
virtual tapes with the AR command "VOLUME". A tape device type of "VTAP-00" in the
command output indicates a virtual tape.
Performance considerations
If there is a remote Virtual Tape started whose TCP/IP connection is slow, then this may have an
impact on the performance of other Virtual Tapes. Therefore ensure that the TCP/IP connection to
the Virtual Tape is stable and fast enough to handle high data transfer rates.
Using TCP/IP 1.5E, the performance of sending data to a remote host can be improved be setting
the "Send Performance Option". This option can be activated in the $SOCKOPT.PHASE. By
default it is not set. Before setting the option you must install the zap ZP15E101. The zap can be
downloaded from the CSI Home Page. Setting the Send Performance Option results in TCP/IP
sending out data packets without waiting for an ACK (acknowledgement).
The following job provides a new $SOCKOPT.PHASE with the Send Performance Option set.
Ensure, that the library with the new $SOCKOPT.PHASE is in front of the TCP/IP library in the
LIBDEF SEARCH CHAIN.
* $$ JOB JNM=SOCKOPT,CLASS=0,DISP=D
// JOB $SOCKOPT
// OPTION CATAL
LOG
// LIBDEF *,SEARCH=PRD2.TCPBETA
// LIBDEF *,CATALOG=PRD2.TEST
* Catalog a new $SOCKOPT phase for TCP/IP 1.5E which includes the
* CSI-supplied options plus the "do not wait after send" option.
* Please ensure that the library with this new $SOCKOPT phase is in
* front of your TCP/IP library within your appl's LIBDEF chain.
NOLOG
// PAUSE OK? Press ENTER to continue
// EXEC ASMA90,SIZE=ASMA90,PARM='SZ(MAX-200K,ABOVE)'
PUNCH ' PHASE $SOCKOPT,* '
$SOCKOPT CSECT
*
* * This phase is used by the BSD-C and SSL interfaces to set options
* * that affect the operation of the interface in a partition...
*
SOCKOPT CSECT, Generate a csect X
BSDCFG1=$OPTSNWT+$OPTMECB, NO-ACK-WAIT, M-ECB-Support X
BSDCFG2=00, Option flag 2 X
CLST=-1, Seconds to wait for close X
CSRT=59, Seconds before socket reuse X
SSLLIBN=KEYLIB, SSL library name X
SSLSUBN=SSLKEYS, SSL sublib name X
SSLMEMN=MYKEY512, SSL member name for keys X
SSLDEBG=00, SSL debugging flag X
SSLFLG1=00, $OPTSRQC, SSL req close_notify alert X
SSLFLG2=00, $OPTSFZA, Force use Z/arch instructns X
SSLFLG3=00, SSL option flag 3 X
SSLSTOR=80, SSL storage useage percent X
SYSID=00, Use this TCP/IP sysid X
SNOWMAX=262144, 256K max for send nowait X
BSDXPHS=IPNRBSDC Name of BSD/C phase
*
END $SOCKOPT
/*
/&
* $$ EOJ
Restrictions
Make sure, that the virtual tape is defined with the "REUSE" parameter, otherwise no overwrite at
all is possible. Once a "VTAPE STOP" command has been issued the EOV ("end of volume")
indication is written to the virtual tape and no further data can be appended. Even when the virtual
tape is re-defined with a new "VTAPE START" command, writing to the tape must start again at
the beginning of the tape.
The DITTO "ERASE TAPE" function is not supported for virtual tapes:
An application issuing the ERASE TAPE function will be cancelled. Use the equivalent VSAM
and PC file system functions instead.
// OPTION STDLABEL=ADD
// DLBL VTAPFIL,'VTAPFIL.TEST.FILE',,VSAM,CAT=IJSYSCT
// VTAPE START,UNIT=181,LOC=VSAM,FILE='VTAPFIL'
The problem is that the VTAPE command will cause a deadlock, if the BG partition is concurrently
updating system standard labels (that is // OPTION STDLABEL is in effect).
Circumvention: Terminate the standard label processing for example by issuing "// OPTION
USRLABEL" before the 'VTAPE START' statement. A correct job control sequence is therefore:
// OPTION STDLABEL=ADD
// DLBL VTAPFIL,'VTAPFIL.TEST.FILE',,VSAM,CAT=IJSYSCT
// OPTION USRLABEL
// VTAPE START,UNIT=181,LOC=VSAM,FILE='VTAPFIL'
Diagnostic Aids
In case of an error situation in virtual tape processing, z/VSE will sometimes return sense
information for the Virtual Tape. The sense information contains a reason code in the bytes 14-15
and a return code in bytes 16-17.
Example:
In the above example the return code is x00C8 and the reason code is x0196
The Return and Reason Codes are also contained in the Trace for the Tape Data Handler.
// EXEC $VTMAIN,SIZE=$VTMAIN,PARM='TRACE'
and set DEBUG ON. The Trace messages will go to SYSLST (job output).
Note: The TAPESRVR completes with a return code of 0008 when running with trace active.
ListVOL1 utility
The ListVOL1 utility (download here
http://www.ibm.com/servers/eserver/zseries/zvse/downloads/tools.html#listvol1)
reads the first 2 tape records of tape image in AWSTAPE format residing in a VSAM ESDS cluster.
It prints the VOLSER and FILEID from the VOL1 and HDR1 labels on the tape. ListVOL1 runs in
a VSE partition (dynamic or static). The partition size must be at least 5 MB. ListVOL1 is started
using
// EXEC LISTVOL1
<DLBL name of VSAM file>
<DLBL name of VSAM file>
/*
where <DLBL name of VSAM file> specifies the DLBL name of a VSAMESDS cluster containing
a VTAPE tape image in AWSTAPE format.
1. TCP/IP for z/VSE has been started with a system whose system ID is specified:
// EXEC IPNET,SIZE=IPNET,PARM='ID=nn,INIT=.....
Where the default for "nn" is "00". To use the TCP/IP services from within another partition
this partition has to 'know' the system ID. This is specified as follows:
// OPTION SYSPARM='nn'
where 'nn' is the system ID. Customers may use the skeleton SKVTASTJ in ICCF lib 59 to
add this statement. This is described in TCP/IP for VSE Programmer's Reference
FILE='D:/Frank''s/Virtual Tapes/vt021401.001'
Windows, UNIX or Linux can have more than 100 characters in length. Therefore you may
specify FILE='filename' twice or even three times. The filename information is concatenated in
storage, thus allowing for a file name length of 200 or even 300. The following example is
equivalent to the one from above:
Copyright IBM Corp. 2007 Page 11
z/VSE Virtual Tape Support
FILE='D:',FILE='/Frank''s/Virtual Tapes/',FILE='vt021401.001'
Windows usually uses back slashes to separate directories (e.g. C:\vtape\tapeiamge.aws). Back
slashes often causes EBCDIC to ASCII code page translation problems; they are translated into
some incorrect characters. Therefore we recommend using forward slashes (e.g.
C:/vtape/tapeiamge.aws) with VTAPE, even when using Windows. Forward slashes usually do
not cause codepage translation problems. The Java runtime automatically converts forward
slashes into back slashes on Windows. If back slashes are used it can happen that the filename
on Windows is treated as relative path instead of an absolute path and the tape image is created
in the Virtual Tape Server's installation directory. This is because Windows does not recognize
the path as absolute if the back slashes are translated into some incorrect characters.