.;	MULTIBAD.CMD		CREATED:	27-SEP-81 K. BETHE
.;
.;	COMMAND FILE TO STARTUP MULTIPLE BADS
.;
.;	18-AUG-82	WRITECHECK THE DISK BEING BADDED
.;
;*****************************************************************
;
;	THIS COMMAND FILE ALLOWS MULTIPLE BADS TO BE STARTED UP
;
;*****************************************************************
.ENABLE SUBSTITUTION
.ENABLE GLOBAL
.SETS DISK <SYDISK>
.IFNINS INI INS $INI
@[1,2]SYSID
.SETS SNAM " SYSTEM "
.SETS $ODSK <SYDISK>
.OPEN BADTMP.CMD
.DATA .ENABLE GLOBAL
.DATA .ENABLE SUBSTITUTION
.MORE:
.ASKN[0:17] UNIT ENTER DRIVE NUMBER FOR PACK TO BE BADDED
.IF <SYUNIT> EQ UNIT .GOTO MORE
.ASKS VOLAB AND WHAT IS THE VOLUME LABEL FOR 'DISK''UNIT'
	CON OFFLINE 'DISK''UNIT':
	CON ONLINE 'DISK''UNIT':
	MOU 'DISK''UNIT':'VOLAB'/VI
.IF <EXSTAT> EQ 1 .GOTO 2
	MOU 'DISK''UNIT':/OVR/VI
	.IF <EXSTAT> EQ 1 DMO 'DISK''UNIT':/LOCK=V/DEV
;******************************************************
;	MOUNT FAILURE
;
;	PLEASE ENTER CORRECT LABEL OR CHANGE DRIVES
;******************************************************
.ASK Q ARE YOU SURE 'DISK''UNIT' SHOULD BECOME 'VOLAB'
.IFF Q .GOTO MORE
.2:
	DMO 'DISK''UNIT':/LOCK=V/DEV
	SET /NOPUB='DISK''UNIT':
	ALL 'DISK''UNIT':
	MOU 'DISK''UNIT':/FOR
	SET /WCHK='DISK''UNIT':
	.SETS NULL ""
	.IF UNIT < 10 .SETS NULL "0"
	INS $BAD/TASK=...B'NULL''UNIT'
	.SETN $ODRV UNIT
	@BRUGETDID
.DATA .WAIT B'NULL''UNIT'
.DATA ; BAD ON 'DISK''UNIT' IS FINISHED
.DATA TIM
.DATA REM B'NULL''UNIT'
.DATA INI 'DISK''UNIT':'VOLAB'/INF=15
.DATA .SETN INIERR <EXSTAT>
.DATA SET /NOWCHK='DISK''UNIT':
.DATA DMO 'DISK''UNIT':/LOCK=V
.DATA DEA 'DISK''UNIT':
.DATA SET /PUB='DISK''UNIT':
.DATA .IF INIERR EQ 1 .GOTO 'UNIT'
.DATA ;**************************************************
.DATA ;		BAD FAILURE ON 'DISK''UNIT'
.DATA ;**************************************************
.DATA 	.GOTO 2'UNIT'
.DATA .'UNIT':
.DATA .ENABLE QUIET
.DATA MOU 'DISK''UNIT':/OVR
.DATA UFD 'DISK''UNIT':[1,7]
.DATA .SETN $DID '$DID'.
.DATA .SETS $FMTON "'$FMTON'"
.DATA .SETS $BADON $SYSID+"'SNAM''DISK''UNIT' "+<DATE>+" "+<TIME>
.DATA .SETN $ODRV 'UNIT'
.DATA @BRUWRTDID
.DATA DMO 'DISK''UNIT':/DEV/LOCK=V
.DATA .DISABLE QUIET
.DATA .2'UNIT':
;	STARTING BAD ON 'DISK''UNIT'
TIM
.XQT B'NULL''UNIT' 'DISK''UNIT':/LI
.ASK Q MORE ?
.IFT Q .GOTO MORE
.CLOSE BADTMP.CMD
	@BADTMP
PIP BADTMP.CMD;*/DE
ERF
.WAIT ERRLOG
CHD 1,6
PIP ERROR.OLD/RE/NV=ERROR.TMP
CHD 1,7
RUN ERRLOG
