	.;
	.;	Compile & Build TCM system
	.;
	.ENABLE GLOBAL
	.ENABLE SUBSTITUTION
	.ENABLE QUIET
	.setn OK 1
	.ask plibld Do you want to compile the TCM PL/I interface
	.ask slvbld Do you want to compile & build the TCM slave task
	.ask logoff Do you want to log off when done
.LOOP:	.DELAY 1S
	.IFACT ...XCC .GOTO LOOP
	.DISABLE QUIET
	.iff plibld .goto slave
	.;
	.; BUILD TCM CALLING TASK ROUTINES
	.;
	mac tcmdsw
	.if <exstat> <> ok .goto exit
	xcc TCMPLI -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMPDELTX -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMPINSTX -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc VSENDRECV -a 'P1'
	.if <exstat> <> ok .goto exit
	lbr tcmpli/cr = TCMDSW,TCMPLI
	.if <exstat> <> ok .goto exit
	lbr tcmpli/in = TCMPDELTX,TCMPINSTX,VSENDRECV
	.if <exstat> <> ok .goto exit
	.iff slvbld .goto exit
.SLAVE:	.;
	.; TCM SLAVE TASK COMPONENTS
	.;
	.testfile SY:VSENDRECV.OBJ
	.if <filerr> eq 1 .goto rcvblt
	xcc VSENDRECV -a 'P1'
	.if <exstat> <> ok .goto exit
.RCVBLT:
	xcc CONECT -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCM -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMATTACH -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMBUF -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMCREATE -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMEDFUNC -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMEDIT -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMERROR -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMFILE -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMINIT -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMINPUT -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMHLP -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMMSG -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMREFORM -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMRETRV -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMREWIN -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMSAVWIN -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMSCRN -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMTAB -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMTDEL -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMTINS -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMTBLS -a 'P1'
	.if <exstat> <> ok .goto exit
	xcc TCMWRD -a 'P1'
	.if <exstat> <> ok .goto exit
	.;
	lbr tcm/cr = CONECT,TCM
	.if <exstat> <> ok .goto exit
	lbr tcm/in = TCMATTACH,TCMBUF,TCMCREATE
	lbr tcm/in = TCMEDFUNC,TCMEDIT,TCMERROR 
	lbr tcm/in = TCMFILE,TCMINIT,TCMINPUT,TCMHLP
	lbr tcm/in = TCMMSG,TCMREFORM,TCMRETRV,TCMREWIN 
	lbr tcm/in = TCMSAVWIN,TCMSCRN,TCMTAB,TCMTDEL,TCMTINS
	lbr tcm/in = TCMTBLS,TCMWRD,VSENDRECV
	.if <exstat> <> ok .goto exit
	.;
	.;ftb @tcm.ftb
	tkb @tcm
.EXIT:
	.ift logoff bye
