AIBSDEV1 ;TAPE SELECTION ROUTINE [ 02/01/89 8:50 AM ]
;1.3 ADDITIONAL CHANGES FOR DSM
;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
;1.1 ;DFM
TAPE ;OPEN TAPE UNIT
X ^%ZOSF("MAGTAPE") S AIBTONL=^%ZOSF("MTONLINE")_" I Y"
S %IS("A")="Enter"_AIBTXIO_"device ",%IS="N",%IS("B")=AIBDFLT
U AIBCDV D ^%ZIS I 'POP S (AIBTDV,AIBDEV)=IO G MOUNT
U AIBCDV W !,"TAPE DRIVE NOT SELECTED" G ABEND
MOUNT ;MOUNT TAPE ON DRIVE, CHECK ONLINE
U AIBCDV W !!,"Mount",AIBTXIO,"Tape on Drive ",AIBTDV,$S(IN&AIBSEQ=1:"",IN:"sequence # "_AIBSEQ,1:" 'WRITE ENABLED' ")," and ",!,"Press ENTER When Ready or '^' to Cancel Processing; "
R AIBR:DTIME I AIBR="^" G OPCANCL
S:$D(AIBSEQ) AIBSEQ=AIBSEQ+1 D OPEN^AIBSDEV
U AIBTDV X AIBTONL I $T G ONLINE
U AIBCDV W !,"Waiting for tape drive to come online" F AIB=1:1:75 U AIBTDV X AIBTONL G:$T ONLINE U AIBCDV W "." H 5
W !!,*7,"Tape not ready after 6 minutes, processing canceled" G ABEND
ONLINE ;TAPE DRIVE IS ONLINE
G:IN REWIND U AIBTDV X ^%ZOSF("MTWPROT") I Y=0 G READY
PROTECT ;TAPE IS PROTECTED
U AIBCDV W *7,!!," Tape is Write Protected, Please Remove the Tape,",!,"And Place a Ring in the Write Ring Groove," G TAPE
READY ;TAPE IS READY
;W %MT("WTM") REMOVED - NOT NEEDED
U AIBCDV R !!,"Enter Volume Serial Number of Output Tape ",AIBV:DTIME
W ! G EXIT
REWIND ;REWIND INPUT TAPE
U AIBCDV W !,"Positioning input tape, please standby" U AIBTDV W @%MT("REW") F L=1:1:150 U AIBCDV X ^%ZOSF("MTBOT") G:Y EXIT W "." H 2
W *7,!!,"Tape not rewound"
ABEND ;ABNORMAL END OF JOB
S AIBA="A" G EXIT
OPCANCL ;OPERATOR CANCEL
S AIBA="C" G EXIT
EXIT ;RETURN TO CALLING PROGRAM
Q
AIBSDEV1 ;TAPE SELECTION ROUTINE [ 02/01/89 8:50 AM ]
+1 ;1.3 ADDITIONAL CHANGES FOR DSM
+2 ;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
+3 ;1.1 ;DFM
TAPE ;OPEN TAPE UNIT
+1 XECUTE ^%ZOSF("MAGTAPE")
SET AIBTONL=^%ZOSF("MTONLINE")_" I Y"
+2 SET %IS("A")="Enter"_AIBTXIO_"device "
SET %IS="N"
SET %IS("B")=AIBDFLT
+3 USE AIBCDV
DO ^%ZIS
IF 'POP
SET (AIBTDV,AIBDEV)=IO
GOTO MOUNT
+4 USE AIBCDV
WRITE !,"TAPE DRIVE NOT SELECTED"
GOTO ABEND
MOUNT ;MOUNT TAPE ON DRIVE, CHECK ONLINE
+1 USE AIBCDV
WRITE !!,"Mount",AIBTXIO,"Tape on Drive ",AIBTDV,$SELECT(IN&AIBSEQ=1:"",IN:"sequence # "_AIBSEQ,1:" 'WRITE ENABLED' ")," and ",!,"Press ENTER When Ready or '^' to Cancel Processing; "
+2 READ AIBR:DTIME
IF AIBR="^"
GOTO OPCANCL
+3 IF $DATA(AIBSEQ)
SET AIBSEQ=AIBSEQ+1
DO OPEN^AIBSDEV
+4 USE AIBTDV
XECUTE AIBTONL
IF $TEST
GOTO ONLINE
+5 USE AIBCDV
WRITE !,"Waiting for tape drive to come online"
FOR AIB=1:1:75
USE AIBTDV
XECUTE AIBTONL
IF $TEST
GOTO ONLINE
USE AIBCDV
WRITE "."
HANG 5
+6 WRITE !!,*7,"Tape not ready after 6 minutes, processing canceled"
GOTO ABEND
ONLINE ;TAPE DRIVE IS ONLINE
+1 IF IN
GOTO REWIND
USE AIBTDV
XECUTE ^%ZOSF("MTWPROT")
IF Y=0
GOTO READY
PROTECT ;TAPE IS PROTECTED
+1 USE AIBCDV
WRITE *7,!!," Tape is Write Protected, Please Remove the Tape,",!,"And Place a Ring in the Write Ring Groove,"
GOTO TAPE
READY ;TAPE IS READY
+1 ;W %MT("WTM") REMOVED - NOT NEEDED
+2 USE AIBCDV
READ !!,"Enter Volume Serial Number of Output Tape ",AIBV:DTIME
+3 WRITE !
GOTO EXIT
REWIND ;REWIND INPUT TAPE
+1 USE AIBCDV
WRITE !,"Positioning input tape, please standby"
USE AIBTDV
WRITE @%MT("REW")
FOR L=1:1:150
USE AIBCDV
XECUTE ^%ZOSF("MTBOT")
IF Y
GOTO EXIT
WRITE "."
HANG 2
+2 WRITE *7,!!,"Tape not rewound"
ABEND ;ABNORMAL END OF JOB
+1 SET AIBA="A"
GOTO EXIT
OPCANCL ;OPERATOR CANCEL
+1 SET AIBA="C"
GOTO EXIT
EXIT ;RETURN TO CALLING PROGRAM
+1 QUIT