.ENABLE GLOBAL
.ENABLE SUBSTITUTION
.ENABLE QUIET
.DISABLE DISPLAY
.;
.; WRTLAB.CMD --
.;
.; This command file will print out a label for tapes or disks from
.; the SYSBRU command procedure using the LA120 DECwriter III.
.;
.; p1 = output device
.; p2 = density if tape device, blank otherwise
.; p3 = utility, ie. BRU, FLX, etc.
.;
	.ONERR Err
	.SETO tmp
	.SETN tmp 33
	.SETS esc "'tmp%V'"
	.SETN status 1
	.IFNDF p1 .GOTO Err
	.IFNDF p2 .SETS p2 ""
	.IFNDF p3 .SETS p3 ""
	.IF p1 = "" .GOTO Err
.;
	.SETF labins
	.IFINS ...LAB .SETT labins
	.IFNINS ...LAB INS $LABEL/TASK=...LAB
	LAB 'p1'
	.IF <exstat> <> 1 .GOTO Err
		@LABEL
		.IF $label = "" .GOTO Err
.;
.; Now we have the label for the device at p1.  Process the other information
.; needed for a label.
.;
	.OPEN #0 LABEL.TMP
	.DATA #0 
	.DATA #0 'esc'[4w
	.DATA #0 '<netnod>'::'p1''$label'	Dens:'p2'
	.DATA #0 '<date>' '<time>'	Utility:'p3'
	.DATA #0 'esc'[1w
	.DATA #0
	.CLOSE #0
.;
	PRI LABEL.TMP/DE
.Endr:
	PIP LABEL.CMD;*/DE/NM
	.IFF labins REM ...LAB
	.EXIT status
.;
.Err:
	.SETN status 4
	.GOTO Endr
.;
