The Check Tape Ready command is designed to be used when an
unattended save is to take place later. The command will ensure that
the tapes are ready and are valid to write on. This includes an
optional check for Volume ID, expiration date, and the CHKSAVDEV TAA
A typical command would be:
The command would ensure that the device is a tape drive, a tape is
mounted, and the tape has expired.
You may optionally enter:
- Multiple devices
- The Volume IDs that must be mounted
- Whether to check the tapes for expiration dates
- Whether to use the CHKSAVDEV TAA Tool on each device
- Whether to request specific escape messages
(This includes an escape message for Write Protected)
CHKTAPRDY escape messages you can monitor for
CPF9898 Some error (Sent for ESCAPE(*NO) conditions)
The following messages are sent if ESCAPE(*YES) is specified:
TAA9881 The tape label is permanent or not expired
- if CLEAR(*NONE)
TAA9882 The tape is Write Protected
- if CHKSAVDEV(*YES)
TAA9883 S/R not working properly
- if CHKSAVDEV(*YES)
TAA9894 The tape is not ready
TAA9895 The tape has no label
TAA9896 Wrong volume mounted (if Volume is specified)
Escape messages from based on functions will be re-sent.
Expiration date checking
CHKTAPRDY works best with a strategy where you do not add files to an
existing tape using different expiration dates. All files on the
same tape should use the same expiration date or all be permanent
If you use the same expiration date for all files on a single tape,
skip the remainder of this section.
If you use different expiration dates for the files on a single tape,
you must understand how the system and CHKTAPRDY work.
The default on the system Save commands is to create a permanent
(*PERM) expiration date. This means the tape files may not be
written over unless CLEAR(*YES) and a specific SEQ value is specified
on a Save command. Or you may initialize the tape using INZTAP or
use the TAA Tool CLRTAP to clear the existing files.
If a date is specified for the EXPDATE keyword on a Save command, the
file may not be written over until the current date is equal or
greater than the expiration date.
You may add files to an existing tape with the SEQ(*END) option on a
Save command. Thus it would be possible to have multiple files with
different expiration dates on the same tape. The Save commands
prevent writing over a file at the beginning of the tape while still
retaining files at the end of the tape. You can begin a Save at a
specific sequence number, but this will erase any files after that
CHKTAPRDY allows you to check the expiration date of the first file
on the tape (there is no SEQ parameter). If the first file has not
expired (or is *PERM), and you have specified CLEAR(*NONE), CHKTAPRDY
will fail with a message stating the file has not expired.
However, if the first file has expired and you are going to start the
save at a sequence number other than 1, your save command may fail
even though checked by CHKTAPRDY.
The CHKSAVDEV TAA Tool command provides a sanity check that the tape
device is working properly. You must specify CHKSAVDEV(*YES) on
CHKTAPRDY to use the function.
CHKSAVDEV will write a file at the beginning of the first tape
mounted on each device specified. You should not use this option if
you are going to start your save at other than SEQ(1).
Command parameters *CMD
DEV A list of up to 4 devices to be used.
VOL A list of up to 4 Volume IDs may be entered. The
default is *MOUNTED.
If a specific list is entered, each device listed is
checked against the sequence specified. For
example, if you have named two devices, the first
Volume must be on the first device and the second
Volume must be on the second device.
You may have more than one volume to be used on a
Save command, but only one volume per device will be
checked by CHKTAPRDY.
If you name only a single device, only a single
Volume ID would be checked.
CLEAR Whether the expiration date of the first file on the
tape will be checked. *NONE is the default and will
cause the expiration date on the first file of each
tape device specified to be checked. If the
expiration date is *PERM or is greater than the
current date, CHKTAPRDY will fail.
*ALL may be specified to bypass the expiration date
check. Using *ALL, the checking is bypassed if the
tape expiration date is *PERM or a specific date.
CHKSAVDEV A *YES/*NO value for whether to run the TAA Tool
CHKSAVDEV on each device specified. *NO is the
default meaning the command is not run.
If *YES is specified, the CHKSAVDEV command will be
run for each device. This will cause a data area to
be saved and then restored to QTEMP. The contents
of the data area are then compared. This provides a
sanity check that the device, the media, and
save/restore code are working properly.
If CLEAR(*NONE) is specified, you will not be able
to write on the tape if the label is permanent or
has not expired.
CHKSAVDEV writes a new file at the beginning of the
tape which will prevent access to any other files on
the tape. Only use this option if you are starting
your save at file sequence 1.
ESCAPE A *YES/*NO value for whether to send specific escape
messages. *NO is the default in which case CPF9898
messages are sent. If a tape is 'Write Protected',
a message is sent to the message queue associated
with the device.
*YES may be specified to cause specific escape
message IDs to be sent for Tape devices. This is
intended to allow specific monitoring within a CL
program. If CHKSAVDEV(*YES) is specified, this also
includes an escape message for the 'Write Protected'
To provide for an escape message for 'Write
Protected', the CHKSAVDEV command makes a temporary
change to the message queue assigned to the tape
device description with the CHGDEVTAP command. A
message queue in QTEMP is used with a default reply.
This allows an automatic reply of cancel to the
inquiry message. Unless the program is interrupted,
the original message queue will be reset in the
device description. This will cause the change date
of the device to be changed.
See the Escape Message section for the specific
escape messages that will be sent.
CHKTAPRDY will only check the expiration date of the first file on a
tape. See the previous discussion.
The following TAA Tools must be on your system:
CHKSAVDEV Check save device
CVTDSPTAP Convert DSPTAP
EXTLST Extract list
RSNLSTMSG Resend last message
RTVDAT Retrieve date
RTVDEVTAP Retrieve device tape
SNDCOMPMSG Send completion message
SNDESCMSG Send escape message
None, the tool is ready to use.
Objects used by the tool
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CHKTAPRDY *CMD TAATAPJ QATTCMD
TAATAPJC *PGM CLP TAATAPJC QATTCL
TAATAPJC2 *PGM CLP TAATAPJC2 QATTCL