COMPILE ROUTINE FIX_SURFACE_SCAN(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Info, Send_Dyn, obj_WO_Step, Set_Status, Btree.Extract, obj_RDS, RList, ErrMsg
DECLARE FUNCTION Get_Status, Set_Printer, obj_RDS, ErrMsg

$INSERT RDS_EQU
$INSERT PROD_SPEC_EQU
$INSERT DICT_EQUATES

EQU TARGET_ACTIVELIST$ TO 5


OPEN 'DICT.SURFACE_SCAN' TO DictSurfaceScan ELSE
	debug
	GOTO Bail
END

OPEN 'SURFACE_SCAN' TO SSFile ELSE
	debug
	GOTO Bail
END


SELECT SSFile


RecCnt = 0
Done = 0
LOOP
	READNEXT SSKey ELSE Done = 1
UNTIL Done
	WONo = SSKey[1,'*']
	WOStep	= SSKey[COL2()+1,'*']
	CassNo	= SSKey[COL2()+1,'*']
	Stage	= SSKey[COL2()+1,'*']
	
	BEGIN CASE
		CASE WONo = ''		; DelFlag = 1
		CASE WOStep = ''	; DelFlag = 1
		CASE CassNo = ''	; DelFlag = 1
		CASE Stage = ''		; DelFlag = 1
		CASE 1				; DelFlag = 0
	END CASE
	
	IF DelFlag THEN
		
		DELETE SSFile,SSKey THEN
			Send_Dyn(SSKey)
		END
	END
	
	
REPEAT


GOTO Bail

DEBUG

* * * * * * *
Bail:
* * * * * * *

END
