
20
SCSI SWITCH (FOR AS/400
®
)
2. Monitor messages for successfully allocating the tape unit. If (as an
example) System A has allocated a tape unit and System B makes a similar
request of the same tape unit, System B would receive a busy message.
The allocation failure will either send a message to the system operator’s
message queue, on System B, or the program that issued the allocation
request (via VRYCFG) can monitor for the message and automate the
response. Below are some of the messages that could be monitored for
(these messages as of V2R3 of OS/400):
CPF2640:
‘Vary Command Not Processed’
CPF6708
‘Command Ended Due to Error’
3. Below is an example of a Control Language program that incorporates
the changes discussed.
/* This program will perform a SAVE LIBRARY NON-SYS*/
PGM (&TAPE)
DCL
VAR(&TAPE) TYPE(*CHAR) LEN(10)
VRY
VRYCFG CFG0BJ(&TAPE) CFGTYPE(*DEV) STATUS(*ON) 1
MONMSG MSGID(CPF2640 CPF6708) EXEC(DO)
2
DLYJOB
DLY(300)
GOTO
VRY
ENDDO
SAVLIB LIB(*NONSYS) DEV(&TAPE) ENDOPT(*UNLOAD)
VRYCFG CFGOBJ(&TAPE) CFGTYPE(*DEV) STATUS(*OFF)3
ENDPGM
Figure 4-1. Control Language Program.