.;OFFBRU.CMD
.;
.; AUTHOR: DAVID B. BURCH
.;	   FERMILAB
.;	   COMPUTING DEPT.
.;	   BISON GROUP
.;
.; MODIFIED BY: NONE.
.;
.; FUNCTION: MOVE INDIVIDUAL UFD'S FROM BRU TAPE TO DISK, CREATING
.;	     DIRECTORIES IF NEEDED, AND OPTIONALLY DELETING FILES
.;	     IF THE DIRECTORY ALREADY EXISTS.
.;
	.ENABLE SUBSTITUTION
	.ASKS INDEV INPUT DRIVE
	.ASKS OUTDEV OUTPUT DRIVE
	.ASKS BACK BACKUP SET
	ASN 'INDEV'=IN:
	ALL 'INDEV'
	ASN 'OUTDEV'=OT:
.TOP:
	.ASKS UIC UIC (^Z TO END)
	.PARSE UIC "[,]" DUMMY GROUP MEMBER
	.TEST GROUP
	.SETN GLENG '<STRLEN>'
	.TEST MEMBER
	.SETN MLENG '<STRLEN>'
	.IF GLENG EQ 1 .SETS GROUP "00'GROUP'"
	.IF GLENG EQ 2 .SETS GROUP "0'GROUP'"
	.IF MLENG EQ 1 .SETS MEMBER "00'MEMBER'"
	.IF MLENG EQ 2 .SETS MEMBER "0'MEMBER'"
	.SETS DIRECT "OT:[0,0]'GROUP''MEMBER'.DIR;1"
	.TESTFILE 'DIRECT'
	.IF <FILERR> EQ 1 .GOTO ERROR
.GO:
	SET /UIC='UIC'
	UFD OT:'UIC'
	BRU /REWIND/DENSITY:1600/NOINI/MOUNTED/BACKUP_SET:'BACK' IN:'UIC' OT:
	.GOTO TOP
.ERROR:
;'UIC' ALREADY EXISTS, FILE ERROR '<FILERR>'
;
	.ASK LIST PRINT DIRECTORY OF 'UIC'
	.IFF LIST .GOTO NOLIST
	.IFINS ...SRD SRD OT:'UIC'*.*;* /MI/NA
	.IFNINS ...SRD PIP OT:'UIC'*.*;* /LI
.NOLIST:
	.ASK DELETE DELETE CURRENT CONTENTS
	.IFF DELETE .GOTO NODEL
	.ASK SURE ARE YOU SURE
	.IFF SURE .GOTO NODEL
	.ASK VSURE ARE YOU VERY SURE
	.IFF VSURE .GOTO NODEL
	SET /UIC=[1,1]
	PIP OT:'UIC'*.*;*/DE
.NODEL:
	.ASK CONT CONTINUE
	.IFT CONT .GOTO GO
	.GOTO TOP
