Compile function Chase_Services(@Service, @Params) #pragma precomp SRP_PreCompiler $insert LOGICAL $Insert RDS_EQUATES $Insert REACTOR_EQUATES $Insert PRS_STAGE_EQUATES $Insert PROD_SPEC_EQUATES equ WOCust$ to 2 Declare function Rds_Services, Database_Services, Extract_SI_Keys, SRP_Clean_Array Declare subroutine Database_Services, Clean_Insp_Services, Extract_SI_Keys GoToService Return Response or "" //----------------------------------------------------------------------------- // SERVICES //----------------------------------------------------------------------------- Service UpdateLoadedPsnWithPostStage() activeWOs = '' // Get all the WOs from the CONFIG table reactorStart = 20 reactorEnd = 79 For reactorNum = reactorStart to reactorEnd ReactType = Xlate('REACTOR', reactorNum, REACTOR_REACT_TYPE$, 'X') If ReactType NE 'EPP' then ReactorConfigKey = 'WO_DAILY_SCHED':reactorNum WoNo = Field(Xlate('CONFIG', ReactorConfigKey, WOCust$, 'X'), ' ', 1) If WoNo NE '' then activeWos := WoNo If reactorNum < reactorEnd then activeWos := @FM end end Next reactorNum For WoIdx = 1 to Len(activeWOs) // Get the RDSs for current WO currentWO = activeWOs RDSColumns = '' RDSColumns<0, 1> = 'SEQ' RdsList = RDS_Services('GetRDSData', currentWO, RDSColumns, False$, '') // Loop through the RDSs For rdsIdx = 1 to Len(RdsList) // If RDS is not FQA, and is in LOAD or UNLOAD run stage, then update the PSN rdsNum = RdsList FqaSigned = Rds_Services("GetFinalQAStatus", rdsNum) RunStatus = Xlate('REACT_RUN', rdsNum, 'RUN_STATUS', 'X') If (Not(FqaSigned)) and ((RunStatus _EQC 'load') or (RunStatus _EQC 'unload')) then PsnNo = Xlate('RDS', rdsNum, RDS_PROD_SPEC_ID$, 'X') specRec = Database_Services('ReadDataRow', 'PROD_SPEC', PsnNo) currentStages = specRec Swap @VM with @FM in currentStages // Determine if a post stage already exists postIdx = 0 For stageIdx = 1 to Len(currentStages) currentStage = currentStages[-4, 4] If currentStage _EQC 'post' then postIdx = stageIdx end Until postIdx GT 0 Next stageIdx postStageRec = '' stageRecKey = PsnNo:'*':'POST' // If post stage already exists, get it If postIdx GT 0 then postStageRec = Database_Services("ReadDataRow", "PRS_STAGE", stageRecKey) end else // otherwise, add the post stage key to the spec currentStageKeys = specRec updatedStageKeys = currentStageKeys:@VM:stageRecKey specRec = updatedStageKeys Database_Services('WriteDataRow', 'PROD_SPEC', PsnNo, specRec) end // Do not override existing specs if post stage already exists currentSurfSigReq = postStageRec If currentSurfSigReq EQ '' then postStageRec = False$ currentSurfRecipe = postStageRec If currentSurfRecipe EQ '' then // construct and apply the correct recipe reactorNum = Xlate('RDS', rdsNum, RDS_REACTOR$, 'X') waferSize = Xlate('CONFIG', 'WO_DAILY_SCHED':reactorNum, 4, 'X')[1, 1] surfScanRecipe = waferSize : 'INCLEAN' postStageRec = surfScanRecipe end // copy other surf scan specs from LWI stage lwiStageRecKey = PsnNo:'*':'LWI' lwiSurfHaze = Xlate('PRS_STAGE', lwiStageRecKey, PRS_STAGE_SURF_HAZE$, 'X')<1, 1> currentSurfHaze = postStageRec If currentSurfHaze EQ '' then postStageRec = lwiSurfHaze lwiSurfDefects = Xlate('PRS_STAGE', lwiStageRecKey, PRS_STAGE_SURF_DEFECTS$, 'X')<1, 1> currentSurfDefects = postStageRec If currentSurfDefects EQ '' then postStageRec = lwiSurfDefects lwiSampleQty = Xlate('PRS_STAGE', lwiStageRecKey, PRS_STAGE_SS_SAMP_QTY$, 'X')<1, 1> currentSampleQty = postStageRec If currentSampleQty EQ '' then postStageRec = lwiSampleQty Database_Services('WriteDataRow', 'PRS_STAGE', stageRecKey, postStageRec) // push out the spec changes runOrderNum = Xlate('RDS', rdsNum, 'RUN_ORDER_NUM', 'X') woMatKey = currentWO : '*' : runOrderNum Clean_Insp_Services('UpdateAllCleanInsp', woMatKey) end Next rdsIdx Next idx End Service Service AddAdHocPostCleanToPsnsByCustomerId(custId, cleansRecipe, TencorRecipe, sd, sh) ProdVerKeys = '' Extract_SI_Keys('PROD_VER', 'CUST_NO', custId, ProdVerKeys) If ProdVerKeys NE '' then PSNs = Xlate('PROD_VER', ProdVerKeys, 'PSN_ID', 'X') UniquePsns = SRP_Clean_Array(PSNs, @VM, 'UNIQUE') For each PsnNo in UniquePsns using @VM setting Idx PsnStatus = Xlate('PROD_SPEC', PsnNo, PROD_SPEC_STATUS$, 'X') If PsnStatus EQ 'A' then postStageRecKey = PsnNo:'*':'POST' postStageRec = Database_Services("ReadDataRow", "PRS_STAGE", postStageRecKey) debug * postCleanTool = 'AKRION1' * currentPostCleanTool = postStageRec * If currentPostCleanTool EQ '' then postStageRec = postCleanTool postCleansRecipe = cleansRecipe currentPostCleanRecipe = postStageRec If currentPostCleanRecipe EQ '' then postStageRec = postCleansRecipe postSurfScanRecipe = TencorRecipe currentPostSurfScanRecipe = postStageRec If currentPostSurfScanRecipe EQ '' then postStageRec = postSurfScanRecipe surfHaze = sh currentPostSurfHaze = postStageRec If currentPostSurfHaze EQ '' then postStageRec = surfHaze surfDefects = sd currentPostSurfDefects = postStageRec<1, 1> If currentPostSurfDefects EQ '' then postStageRec = surfDefects Database_Services('WriteDataRow', 'PRS_STAGE', postStageRecKey, postStageRec) end Next PsnNo end end service