.;	COPY.CMD	-	DCL COPY COMMAND
.;	**********************************************
.;	M.BRUNECKY	VER.001.	NOVEMBER 1981.
.;
.;	THIS COMMAND FILE ASSUMES PRE-PARSED COMMAND FORM
.;	$COPY [/QUAL] [INP] [TO] [OUT]
	.ENABLE QUIET
	.SETS Q""			;DEFAULT NO QUALIFIERS
	.IF P1 = "" .GOTO C10
	.SETS X P1[1:1]
	.IF X NE "/" .GOTO C10
	.SETS Q P1
	.SETS P1 P2
	.SETS P2 P3
	.SETS P3 P4
.C10:	.IF P1 = "" .ASKS P1 input file(s/sw)
	.IF P1 = "TO" .OR.IF P1 = "" .GOTO C10
	.IF P2 = "TO" .SETS P2 P3
	.IF Q NE "/DO/ZE" .GOTO C20
	.PARSE P1 ":" P1 X
	.ENABLE SUBSTITUTION 
	FLX 'P1':/DO/ZE
	.EXIT
.C20:	.IF P2 = "" .ASKS P2 output file(/sw)
	.PARSE P2 "]" X Y
	.IFNDF Y .SETS Y ""
	.IFNDF X .SETS X ""
	.IF Y = "" .SETS Y X
	.PARSE Y "," X Y
	.IF Y NE "" MSG COPY -- MULTIPLE OUTPUT FILES ILEGAL
	.IF Y NE "" .SETS P2 ""
	.IF Y NE "" .GOTO C20
	.SETS PRG "DCL"
	.SETS X P1
	.GOSUB CXX
	.SETS X P2
	.GOSUB CXX
	.PARSE P2 "/" X Y
 	.PARSE X ":" Y X
	.IF PRG = "FLX" .IF X NE "" MSG COPY -- OUTPUT FILESPEC ILEGAL
	.IF PRG = "FLX" .IF X NE "" .GOTO C20
	.ENABLE SUBSTITUTION
	'PRG' 'P2''Q'='P1'
	.EXIT
.CXX:	.PARSE X "/" X Y
	.IF Y = "" .RETURN
	.SETS X Y[1:2]
	.IF X = "DO" .OR .IF X = "RS" .OR .IF X = "RT" .SETS PRG "FLX"
	.IF X = "DO" .OR .IF X = "ZE" .OR .IF X = "RT" .SETS PRG "FLX"
	.GOTO CXX
				
