.;
.;----------------------------------------------------------------------------
.;
.;	CMD-PROGRAM:	TSKCOPY.CMD
.;
.;	AUTHOR:		Jan H. Belgraver
.;
.;	DATE:		MAR-JUL-1980
.;
.;	PURPOSE:	TSKCOPY copies all SYSTEM tasks to the new system disk
.;
.;	MODIFIED:	Jan H. Belgraver	15-APR-81	JB01
.;			Incorporated SRD to selectively create a file sorted
.;			by name of system tasks to be copied. 
.;
.;----------------------------------------------------------------------------
.;
.ENABLE SUBSTITUTION
.;
.IFNDF	$UIC	.SETS	$UIC	<UIC>
.IFDF	$DEVOU	.GOTO CONTIN
		.SETS	$DEVOU	"DM:"
		.ASKS	DEV	Enter output device, [<CR>='$DEVOU']
		.IF	<STRLEN> NE 0	.SETS	$DEVOU DEV
;
		.SETS	$DEVIN	"DM1:"
		.ASKS	DEV	Enter  input device, [<CR>='$DEVIN']
		.IF	<STRLEN> NE 0	.SETS	$DEVIN DEV
.CONTIN:
.;
.SETS	DAYDAT	<DATE>
.SETS	DAYTIM	<TIME>
;
;	Starting sysgen system tasks copy on 'DAYDAT' at 'DAYTIM'
;
.;----------------------------------------------------------------------------
;
;
	SET /UIC=[1,54]
;
.GETDAT:
	.ASKS	SGNDAT	Enter sysgen date				.
	.IF	<STRLEN> EQ 0	.GOTO GETDAT:
	.XQT	SRD '$DEVIN'SYSTASKS.DIR='$DEVIN'/NA/WB/DA:'SGNDAT'
	.WAIT	SRD
		PIP LP:='$DEVIN'TASKS.DIR
.;
	.ASK	EDIT	Do you want to edit SYSTASKS.DIR before copying.
	.IFF	EDIT	.GOTO	START
;	Pausing to enable editing file SYSTASKS.DIR
	.PAUSE
.;
.START:
	.OPENR	'$DEVIN'SYSTASKS.DIR
.LOOP:
	.READ	TSKNAM
	.IFT <EOF>	.GOTO FINISH
	.IF  <FILERR> NE 1	.GOTO ERROR
	.TEST	TSKNAM
	.PARSE	TSKNAM	".;"	NAME TYPE VERS
	.SETS	VERS	VERS[1:4]
	.SETS	CHECK	NAME[1:1]
	.IF	CHECK EQ " "	.GOTO	LOOP
.;	'NAME'.'TYPE';'VERS'
	PIP '$DEVOU'/CD/CO='$DEVIN''NAME'.'TYPE';'VERS'
	.GOSUB	CHECK
	.GOTO	LOOP
.;
.;----------------------------------------------------------------------------
.;
.CHECK:
.;
.SETT	STATUS
.IF	<EXSTAT> NE 1	.SETF STATUS
.IFF	STATUS	; *** PIP COPY PROBLEM ***, EXIT STATUS: '<EXSTAT>'
.IFF	STATUS	.PAUSE
.RETURN
.;
.;----------------------------------------------------------------------------
.;
.ERROR:
;		ERROR '<FILERR>' IN '<FILSPC>'
	.GOTO	LOOP
.;
.FINISH:
.;
.;	Delete protect copied tasks.
.;
.IF	$DEVOU NE "DM:"	.GOTO END
.IF	$DEVOU NE "DM1:" .GOTO END
.;
	PIP '$DEVOU'*.TSK;*/PR:104210
.WAIT	PIP
.;
.END:
.;
	SET /UIC='$UIC'
.;
.EXIT
