COMPILE SUBROUTINE Print_Control_Plan_New( PSNo, WONo )


DECLARE SUBROUTINE ErrMsg
DECLARE FUNCTION Set_Printer, Get_printer, Msg,obj_Install,Printer_Select, obj_Prod_Spec

$INSERT OIPRINT_EQUATES
$INSERT PROD_SPEC_EQU
$INSERT QUOTE_SPEC_EQU
$INSERT WO_LOG_EQU
$INSERT ORDER_DET_EQU
$INSERT COMPANY_EQU
$INSERT RECIPE_EQU
$INSERT RDS_LAYER_EQUATES
$INSERT RDS_TEST_EQUATES
$INSERT PRS_LAYER_EQU
$INSERT APPCOLORS



EQU PI$LEFT		TO 1
EQU PI$TOP		TO 2
EQU PI$RIGHT	TO 3
EQU PI$BOTTOM	TO 4
EQU PI$WIDTH	TO 5
EQU PI$HEIGHT	TO 6
EQU PI$SIZE		TO 7


EQU FONT_NAME$		TO 1
EQU FONT_SIZE$		TO 2
EQU FONT_JUST$		TO 3
EQU FONT_BOLD$		TO 4
EQU FONT_ITALIC$	TO 5
EQU FONT_UNDERLINE$	TO 6

EQU STEP_STEP$			TO 1
EQU STEP_PROCESS_NAME$	TO 2
EQU STEP_MACHINE$		TO 3
EQU STEP_PSN$			TO 4
EQU STEP_PRODUCT$		TO 5
EQU STEP_PROCESS$		TO 6
EQU STEP_SPEC_TOL$		TO 7
EQU STEP_EVAL_MEAS$		TO 8
EQU STEP_SIZE$			TO 9
EQU STEP_FREQ$			TO 10
EQU STEP_CTRL_METHOD$	TO 11
EQU STEP_REACT_PLAN$	TO 12

IF NOT(ASSIGNED(PSNo)) THEN RETURN
IF NOT(ASSIGNED(WONo)) THEN WONo = ''


* * *   PRINT SETUP   * * *


FileName 	= 'Print Control Plan'
Title		= 'Print Control Plan'

PageInfo	= ''				; * Default is .5 inch margins and 8.5 x 11 paper
PageInfo<PI$LEFT>	= 0.5
PageInfo<PI$TOP>	= 1.5
PageInfo<PI$RIGHT>	= 0.5
PageInfo<PI$BOTTOM>	= 0.5
PageInfo<PI$SIZE>	= LETTER

PageSetup	= 1					;* 1 = Landscape mode

PrintSetup	= ''
PrintSetup<1,1>	= '2'	;* Preview Normal
PrintSetup<1,2> = '5'	;* Show Print and PDF, hide Print Setup
PrintSetup<1,3>	= '0'	;* Show the printing window
PDFParms = 'Printing PDF Document':@FM: '' :@FM:'':@FM: ''
		
stat = Set_Printer( 'INIT', PDFParms, 'Run Data Sheet',PageInfo,PageSetup,PrintSetup)

Margins			= Get_Printer('MARGIN')
LMargin = Margins<1>
TMargin	= Margins<2>
RMargin = Margins<3>
BMargin	= Margins<4>

PageSize	= Get_Printer('PAGESIZE')
PageWidth	= PageSize<1>
PageHeight	= PageSize<2>

MaxPrintWidth = PageWidth - LMargin - RMargin
MaxPrintHeight = PageHeight - TMargin - BMargin

font = 'Arial'		;* Font basics
font<2> = 10
font<4> = 0

stat = Set_Printer('FONTHEADFOOT', font)

stat = Set_Printer('LINESTYLE', PS_SOLID:@FM:2)
stat = Set_Printer('LINE', -0.1:@FM:-1.2:@FM:10.0:@FM:-1.2, 1)
stat = Set_Printer('LINE', -0.1:@FM:-0.1:@FM:10.0:@FM:-0.1, 1)
 
location = -0.15:@FM:-1.150:@FM:1.57:@FM:1
stat = Set_Printer('BMP',obj_Install('Get_Prop','ColorBMP'),location, 0,1)

RSideGraphicX = (1.57 - .15)
RSideTextX = (MaxPrintWidth - 1.75)

HeaderMidX = ((RSideTextX - RSideGraphicX)/2) + RSideGraphicX

* * * *  Added 10/8/2015 JCH - Updated 'CONFIG','COMPANY'  * * * *

InstDat		= obj_Install('Get_Prop','Company':@FM:'Division')
Company		= InstDat<1>
Division	= InstDat<2>
	
font	= 'Arial'
font<2>	= '12'		;* Big type
font<4>	= 1			;* Bold on
font<5> = 0			;* Italics

stat = Set_Printer('TEXTXY',Company,RSideTextX:@FM:-1.15,font,1)
stat = Set_Printer('TEXTXY',Division,RSideTextX:@FM:-0.970,font,1)

font<2> = 10	;* 10 point font
font<4> = 0		;* Bold off
font<5> = 0		;* Italics Off

stat = Set_Printer('TEXTXY',obj_Install('Get_Prop','Address'), RSideTextX:@fm:-0.775, font,1)
stat = Set_Printer('TEXTXY',obj_Install('Get_Prop','CSZC'), RSideTextX:@fm:-0.625, font,1)
stat = Set_Printer('TEXTXY','Tel:      ':obj_Install('Get_Prop','Phone'), RSideTextX:@fm:-0.475, font, 1)
stat = Set_Printer('TEXTXY','FAX:    ':obj_Install('Get_Prop','FAX'), RSideTextX:@fm:-0.325, font, 1)

* * * *  End of changes 10/8/2015 JCH  * * * *


font	= 'Arial'
font<2>	= '18'		;* Big type
font<4>	= 1			;* Bold on
font<5> = 1			;* Italics

stat = Set_Printer('FONT',font)

stat		= Set_Printer("CALCTEXT", 'Control Plan')
titleSize	= Get_Printer("CALCTEXT")
titleWidth 	= titleSize<1>
titleHeight = titleSize<2>

titleStartX = HeaderMidX - (titleWidth/2)

stat = Set_Printer('TEXTXY','Control Plan',titleStartX:@FM:-1.0,font,1)

font<2> = '16'
font<4> = 0

stat = Set_Printer('FONT',font)

CustName = XLATE('PROD_SPEC',PSNo,'CUST_NAME','X')

stat		= Set_Printer("CALCTEXT", 'PSN: ':PSNo:' - ':CustName)
psnSize		= Get_Printer("CALCTEXT")
psnWidth 	= psnSize<1>
psnHeight 	= psnSize<2>

psnStartX = HeaderMidX - (psnWidth/2)

stat		= Set_Printer("CALCTEXT", 'Work Order No: ':WONo)
woSize		= Get_Printer("CALCTEXT")
woWidth 	= woSize<1>
woHeight 	= woSize<2>

woStartX = HeaderMidX - (woWidth/2)

IF WONo NE '' THEN
	stat = Set_Printer('TEXTXY','PSN: ':PSNo:' - ':CustName,psnStartX:@FM:-0.68,font,1)
	stat = Set_Printer('TEXTXY','Work Order No: ':WONo,woStartX:@FM:-0.40,font,1)
	
	WORec	= XLATE('WO_LOG',WONo,'','X')
	Order	= WORec<WO_LOG_ORDER_NO$>
	OrdItem = WORec<WO_LOG_ORDER_ITEM$>
	SubPartNo = XLATE('ORDER_DET',Order:'*':OrdItem,ORDER_DET_SUB_PART_NO$,'X')
	
END ELSE
	stat = Set_Printer('TEXTXY','PSN: ':PSNo:' - ':CustName,psnStartX:@FM:-0.60,font,1)
	SubPartNo = ''
END

font<2> = 12	;* Drop the font size
font<5> = 0		;* Italics off

stat = Set_Printer('FOOTER',"Page 'P'":@VM:@VM:"'T' 'D'")

* Extract Prod Spec data

WORec = XLATE('WO_LOG',WONo,'','X')
PSNRec = XLATE('PROD_SPEC',PSNo,'','X')

SpecSubInfo = PSNRec<prod_spec_spec_substrate$>
SpecialInst = SpecSubInfo<1,QSSubInstructions$>
Orientation = SpecSubInfo<1,QSSubOrientation$>
ProdType	= SpecSubInfo<1,QSSubType$>

SpecAddtl   = PSNRec<prod_spec_spec_addtl$>
ProveinInst = SpecAddtl<1,QSAddProveInInst$>

EntryDt		= OCONV(PSNRec<PROD_SPEC_ENTRY_DATE$>,'D2/')
RevDt		= OCONV(PSNRec<PROD_SPEC_MOD_DATE$>,'D2/')

KeyContact	= "Onsite Quality Representative (480) 668-4000"
CoreTeam	= 'Executive Director, Quality Manager, Process Engineering Manager, Maintenance Engineering Manager, Manufacturing Manager (480) 668-4000'

*SWAP @TM WITH CRLF$ IN SpecialInst
*SWAP @TM WITH CRLF$ IN ProveInInst


SpecType = PSNrec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubSpecType$>

BEGIN CASE
	CASE SpecType = 'U'
		Sig		= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddPreQualSig$>
		SigDt	= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddPreQualSigDate$>
		
	CASE SpecType = 'Q'
		Sig		= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddQualSig$>
		SigDt	= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddQualSigDate$>
		
	CASE SpecType = 'X'
		Sig		= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddPreProdSig$>
		SigDt	= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddPreQualSigDate$>
		
	CASE SpecType = 'P'
		Sig		= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddProdSig$>
		SigDt	= PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddProdSigDate$>	
	
END CASE

Font = 'Arial'
Font<FONT_JUST$>		= 'L'
Font<FONT_SIZE$>		= 8
Font<FONT_UNDERLINE$>	= 0
Font<FONT_BOLD$>		= 0
Void = Set_Printer( 'FONT', Font )

* First line of Specification

colHeader 	   = 'Description'			; colFormat      = '^1440'
colHeader<1,2> = 'Type'					; colFormat<1,2> = '^1440'
colHeader<1,3> = 'Signed'				; colFormat<1,3> = '^1080'
colHeader<1,4> = 'Key Contact'			; colFormat<1,4> = '^2520'
colHeader<1,5> = 'Core Team'			; colFormat<1,5> = '^5760'
colHeader<1,6> = 'Original Dt'			; colFormat<1,6> = '^1080'
colHeader<1,7> = 'Last Rev'				; colFormat<1,7> = '^1080'

colData      = PSNRec<PROD_SPEC_LAYER_TYPE$>
colData<1,2> = OCONV(SpecType,'[SPEC_TYPE_CONV]')
colData<1,3> = OCONV(SigDt,'D4/')
colData<1,4> = KeyContact
colData<1,5> = CoreTeam
colData<1,6> = EntryDt
colData<1,7> = RevDt

stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,TB_ALL)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,TB_ALL)

stat = Set_Printer('TEXT')

* Second line of Specification

PSNLayerProps = obj_Prod_Spec('GetLayerProp',PSNo)


LSIDs = ''
Dopants = ''
colData = ''

FOR I = 1 TO COUNT(PSNLayerProps,@RM) + (PSNLayerProps NE '')
	LayerSet = FIELD(PSNLayerProps,@RM,I)
	LSIDs<I> = LayerSet<1>
	LayerSet = FIELD(LayerSet,@FM,2,99)
	
	Dopants<1,I> = LayerSet<PRS_LAYER_DOPANT$>
	
	IF I = 1 THEN
	
		RecipeNo	= LayerSet<PRS_LAYER_RECIPE$>
		RecipeRec	= XLATE('RECIPE',RecipeNo,'','X')
		RecipeName	= RecipeRec<RECIPE_RECIPE_NAME$>
		EpiGas		= RecipeRec<RECIPE_EPI_GASES$>

		BEGIN CASE
			CASE EpiGas = 'SiH4'		; EpiGasName = 'Silane'
			CASE EpiGas = 'SiH2CL2'		; EpiGasName = 'DiChloroSilane (DCS)'
			CASE EpiGas = 'SiH1HCL3'	; EpiGasName = 'TriChloroSilane (TCS)'
			CASE 1	; EpiGasName = ''
		END CASE

		
		
		CustPartNos		= PSNRec<PROD_SPEC_CUST_PART_NO$>
		CustPartDescs	= PSNRec<PROD_SPEC_PN_DESC$>
		
		SWAP @VM WITH CRLF$ IN CustPartNos
		SWAP @VM WITH CRLF$ IN CustPartDescs
		
		colData<I,1> = 'Silcon Epitaxy'
		colData<I,2> = PSNo
		colData<I,3> = CustPartNos
		colData<I,4> = CustPartDescs
		colData<I,5> = Recipename
		colData<I,6> = EpiGas
		colData<I,7> = SubPartNo
		colData<I,8> = Orientation
		colData<I,9> = ProdType
	END
	
NEXT I

colHeader      = 'Product'				; colFormat      = '<2160'
colHeader<1,2> = 'Prod Spec'			; colFormat<1,2> = '^1440'
colHeader<1,3> = 'Cust Part No'			; colFormat<1,3> = '^1440'
colHeader<1,4> = 'Part Desc'			; colFormat<1,4> = '<2160'
colHeader<1,5> = 'Recipe'				; colFormat<1,5> = '^1440'
colHeader<1,6> = 'Epi Gas'				; colFormat<1,6> = '^1440'
colHeader<1,7> = 'Prod Sub No'			; colFormat<1,7> = '^1440'
colHeader<1,8> = 'Prod Orientation'		; colFormat<1,8> = '^1440'
colHeader<1,9> = 'Prod Type'			; colFormat<1,9> = '^1440'


stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,TB_ALL)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,TB_ALL)

colData = ''

stat = Set_Printer('TEXT')

colHeader = 'LS':CRLF$:'Id':@VM				; colFormat = '^540':@VM
colHeader<1,2> = 'Dopant':@VM				; colFormat<1,2> = '^1440':@VM
colHeader<1,3> = 'Measure':@VM				; colFormat<1,3> = '<1440':@VM
colHeader<1,4> = 'Minimum':@VM				; colFormat<1,4> = '^1440':@VM
colHeader<1,5> = 'Target':@VM				; colFormat<1,5> = '^1440':@VM
colHeader<1,6> = 'Maximum':@VM				; colFormat<1,6> = '^1440':@VM
colHeader<1,7> = 'Tool':@VM					; colFormat<1,7> = '<1080':@VM
colHeader<1,8> = 'Monitor Type':@VM			; colFormat<1,8> = '<1440':@VM
colHeader<1,9> = 'Recipe':@VM				; colFormat<1,9> = '<2160':@VM
colHeader<1,10> = 'Frq':@VM					; colFormat<1,10> = '^540':@VM
colHeader<1,11> = 'ProveIn Type'			; colFormat<1,11> = '<1440'

* Build Step Data * * * * 

ReactorType = OCONV(PSNRec<PROD_SPEC_REACTOR_TYPE$> ,'[REACT_TYPE_CONV,OPSREF]' )

LayerCnt = COUNT(LSIDs,@FM) + (LSIDs NE '')

SDIndex = 0
StepData = ''
colData = ''

FOR I = 1 TO LayerCnt
	LayerSet = LSIDs<I>
	LayerSpecs = obj_Prod_Spec('GetLayerProp',PSNo:@RM:LayerSet:@RM:'')		;* Last parameter specifies no output conversion on return data

	LayerSpecs = FIELD(LayerSpecs,@FM,2,99)		;* Returns with the layer set ID in the first field of each line

	LSID 			= LSIDs<I>
	
	ThickMin		= LayerSpecs<PRS_LAYER_THICK_MIN$>
	ThickTarget 	= LayerSpecs<PRS_LAYER_THICK_TARGET$>
	ThickMax		= LayerSpecs<PRS_LAYER_THICK_MAX$>
	ThickUnits		= LayerSpecs<PRS_LAYER_THICK_UNITS$>
	
	ThickMTool		= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MTOOL$>
	ThickMType		= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MTYPE$>
	ThickMRecipe	= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MRECIPE$>
	ThickMFreq		= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MFREQ$>
	ThickMPIType	= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MPROVEIN$>
	ThickMFirst		= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MFIRST$>
	ThickMLast		= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MLAST$>
	ThickMSPC		= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MSPC$>
	ThickMOvergrow	= LayerSpecs<PRS_LAYER_THICK_MEASUREMENT$,PRS_MOVERGROW$>
	
	
	
	ResMin			= LayerSpecs<PRS_LAYER_RES_MIN$>
	ResTarget		= LayerSpecs<PRS_LAYER_RES_TARGET$>
	ResMax			= LayerSpecs<PRS_LAYER_RES_MAX$>
	ResUnits		= LayerSpecs<PRS_LAYER_RES_UNITS$>
	
	ResMTool		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MTOOL$>
	ResMType		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MTYPE$>
	ResMRecipe		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MRECIPE$>
	ResMFreq		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MFREQ$>
	ResMPIType		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MPROVEIN$>
	ResMFirst		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MFIRST$>
	ResMLast		= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MLAST$>
	ResMSPC			= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MSPC$>
	ResMOvergrow	= LayerSpecs<PRS_LAYER_RES_MEASUREMENT$,PRS_MOVERGROW$>
	
	
	IF I = 1 THEN FirstResUnits = ResUnits
	
		
	ConMin			= LayerSpecs<PRS_LAYER_CONC_MIN$>
	ConTarget		= LayerSpecs<PRS_LAYER_CONC_TARGET$>
	ConMax			= LayerSpecs<PRS_LAYER_CONC_MAX$>
	ConUnits		= LayerSpecs<PRS_LAYER_CONC_UNITS$>
	
	ConMTool		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MTOOL$>
	ConMType		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MTYPE$>
	ConMRecipe		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MRECIPE$>
	ConMFreq		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MFREQ$>
	ConMPIType		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MPROVEIN$>
	ConMFirst		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MFIRST$>
	ConMLast		= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MLAST$>
	ConMSPC			= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MSPC$>
	ConMOvergrow	= LayerSpecs<PRS_LAYER_CONC_MEASUREMENT$,PRS_MOVERGROW$>
	
	
	CResMin			= LayerSpecs<PRS_LAYER_CRES_MIN$>
	CResTarget		= LayerSpecs<PRS_LAYER_CRES_TARGET$>
	CResMax			= LayerSpecs<PRS_LAYER_CRES_MAX$>
	CResUnits		= LayerSpecs<PRS_LAYER_CRES_UNITS$>
	
	CResMTool		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MTOOL$>
	CResMType		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MTYPE$>
	CResMRecipe		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MRECIPE$>
	CResMFreq		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MFREQ$>
	CResMPIType		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MPROVEIN$>
	CResMFirst		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MFIRST$>
	CResMLast		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MLAST$>
	CResMSPC		= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MSPC$>
	CResMOvergrow	= LayerSpecs<PRS_LAYER_CRES_MEASUREMENT$,PRS_MOVERGROW$>
	
	
	
	colData<I,1> = LSID
	colData<I,2> = Dopants<1,I>
	colData<I,3> = 'Thickness'
	colData<I,4> = ThickMin:ThickUnits
	colData<I,5> = ThickTarget:ThickUnits
	colData<I,6> = ThickMax:ThickUnits
	colData<I,7> = ThickMTool
	colData<I,8> = ThickMType
	colData<I,9> = ThickMRecipe
	colData<I,10> = ThickMFreq
	colData<I,11> = ThickMPIType
	
	
	IF ResTarget NE '' THEN
		colData<I,1> = colData<I,1>:CRLF$
		colData<I,2> = colData<I,2>:CRLF$
		colData<I,3> = colData<I,3>:CRLF$:'Resistivity'
		colData<I,4> = colData<I,4>:CRLF$:ResMin:ResUnits
		colData<I,5> = colData<I,5>:CRLF$:ResTarget:ResUnits
		colData<I,6> = colData<I,6>:CRLF$:ResMax:ResUnits
		colData<I,7> = colData<I,7>:CRLF$:ResMTool
		colData<I,8> = colData<I,8>:CRLF$:ResMType
		colData<I,9> = colData<I,9>:CRLF$:ResMRecipe
		colData<I,10> = colData<I,10>:CRLF$:ResMFreq
		colData<I,11> = colData<I,11>:CRLF$:ResMPIType
	END
	
	
	IF ConTarget NE '' THEN
		colData<I,1> = colData<I,1>:CRLF$
		colData<I,2> = colData<I,2>:CRLF$
		colData<I,3> = colData<I,3>:CRLF$:'Concentration'
		colData<I,4> = colData<I,4>:CRLF$:ConMin:ConUnits
		colData<I,5> = colData<I,5>:CRLF$:ConTarget:ConUnits
		colData<I,6> = colData<I,6>:CRLF$:ConMax:ConUnits
		colData<I,7> = colData<I,7>:CRLF$:ConMTool
		colData<I,8> = colData<I,8>:CRLF$:ConMType
		colData<I,9> = colData<I,9>:CRLF$:ConMRecipe
		colData<I,10> = colData<I,10>:CRLF$:ConMFreq
		colData<I,11> = colData<I,11>:CRLF$:ConMPIType
	END
	 
	IF CResTarget NE '' THEN
		colData<I,1> = colData<I,1>:CRLF$
		colData<I,2> = colData<I,2>:CRLF$
		colData<I,3> = colData<I,3>:CRLF$:'CRes'
		colData<I,4> = colData<I,4>:CRLF$:CResMin:CResUnits
		colData<I,5> = colData<I,5>:CRLF$:CResTarget:CResUnits
		colData<I,6> = colData<I,6>:CRLF$:CResMax:CResUnits
		colData<I,7> = colData<I,7>:CRLF$:CResMTool
		colData<I,8> = colData<I,8>:CRLF$:CResMType
		colData<I,9> = colData<I,9>:CRLF$:CResMRecipe
		colData<I,10> = colData<I,10>:CRLF$:CResMFreq
		colData<I,11> = colData<I,11>:CRLF$:CResMPIType
	END 
	
	 
	colData<I,1> = colData<I,1>:CRLF$
	colData<I,2> = colData<I,2>:CRLF$
	colData<I,3> = colData<I,3>:CRLF$
	colData<I,4> = colData<I,4>:CRLF$
	colData<I,5> = colData<I,5>:CRLF$
	colData<I,6> = colData<I,6>:CRLF$
	colData<I,7> = colData<I,7>:CRLF$
	colData<I,8> = colData<I,8>:CRLF$
	colData<I,9> = colData<I,9>:CRLF$
	colData<I,10> = colData<I,10>:CRLF$
	colData<I,11> = colData<I,11>:CRLF$
	
	
	IF ThickMTool NE '' THEN
		SDIndex += 1
		
		SWAP 'æm'	WITH 'um'		in ThickUnits 
		SWAP ''	WITH 'A'		in ThickUnits
		
		Freq = ''
		IF ThickMFirst	NE '' THEN Freq  = 'First, '
		IF ThickMFreq	NE '' THEN Freq := ThickMFreq:', '
		IF ThickMLast	NE '' THEN Freq := 'Last'

		IF ThickMSPC = '' THEN ThickMSPC = '0'
	
		stepData<SDIndex,STEP_STEP$>			= SDIndex
		stepData<SDIndex,STEP_PROCESS_NAME$>	= 'Epitaxy Layer ':I
		stepData<SDIndex,STEP_MACHINE$>			= ReactorType
		stepData<SDIndex,STEP_PSN$>				= PSNo
		stepData<SDIndex,STEP_PRODUCT$>			= CHAR(185):'Thickness'
		stepData<SDIndex,STEP_PROCESS$>			= 'Epi Growth'
		stepData<SDIndex,STEP_SPEC_TOL$>		= ThickMin:' - ':ThickMax:ThickUnits
		stepData<SDIndex,STEP_EVAL_MEAS$>		= ThickMTool
		stepData<SDIndex,STEP_SIZE$>			= ThickMType
		stepData<SDIndex,STEP_FREQ$>			= ThickMFreq
		stepData<SDIndex,STEP_CTRL_METHOD$>		= OCONV(ThickMSPC, 'BSPC,WI' )
		stepData<SDIndex,STEP_REACT_PLAN$>		= 'OCAP'
	END
	
	
	IF ResMTool NE '' THEN
		SDIndex += 1
	
		SWAP 'ê-cm'	WITH 'ohm.cm'	in ResUnits
		SWAP 'ê/Ü'	WITH 'ohm/sq'	in ResUnits
		
		IF ResMtype = 'Prod' THEN ResMType = '1 Prod Wafer'
		
		Freq = ''
		IF ResMFirst	NE '' THEN Freq  = 'First, '
		IF ResMFreq		NE '' THEN Freq := ResMFreq:', '
		IF ResMLast		NE '' THEN Freq := 'Last'
		
		IF ResMSPC = '' THEN ResMSPC = '0'

		stepData<SDIndex,STEP_STEP$>			= SDIndex
		stepData<SDIndex,STEP_PROCESS_NAME$>	= 'Epitaxy Layer ':I
		stepData<SDIndex,STEP_MACHINE$>			= ReactorType
		stepData<SDIndex,STEP_PSN$>				= PSNo
		stepData<SDIndex,STEP_PRODUCT$>			= CHAR(185):'Resistivity'
		stepData<SDIndex,STEP_PROCESS$>			= 'Epi Growth'
		stepData<SDIndex,STEP_SPEC_TOL$>		= ResMin:' - ':ResMax:ResUnits
		stepData<SDIndex,STEP_EVAL_MEAS$>		= ResMTool
		stepData<SDIndex,STEP_SIZE$>			= ResMType
		stepData<SDIndex,STEP_FREQ$>			= ResMFreq
		stepData<SDIndex,STEP_CTRL_METHOD$>		= OCONV(ResMSPC,'BSPC,WI')
		stepData<SDIndex,STEP_REACT_PLAN$>		= 'OCAP'
		
	END
	
	IF ConMTool NE '' THEN
		SDIndex += 1
	
		SWAP 'ê-cm'	WITH 'ohm.cm'	in ConUnits
		SWAP 'ê/Ü'	WITH 'ohm/sq'	in ConUnits
		
		Freq = ''
		IF ConMFirst	NE '' THEN Freq  = 'First, '
		IF ConMFreq		NE '' THEN Freq := ConMFreq:', '
		IF ConMLast		NE '' THEN Freq := 'Last'
		
		IF ConMType = 'Prod' THEN ConMType = '1 Prod Wafer'
		
		IF ConMTool = 'SRP' THEN
			SpecTol		= 'See Hard Copy Spec'
			Product		= 'SRP'
			Frequency	= 'Per Metrology'
		END ELSE
			SpecTol		= ConMin:' - ':ConMax:ConUnits
			Product 	= 'Conductivity'
			Frequency	= ConMFreq
		END
		
		IF ConMSPC = '' THEN ConMSPC = '0'

		stepData<SDIndex,STEP_STEP$>			= SDIndex
		stepData<SDIndex,STEP_PROCESS_NAME$>	= 'Epitaxy Layer ':I
		stepData<SDIndex,STEP_MACHINE$>			= ReactorType
		stepData<SDIndex,STEP_PSN$>				= PSNo
		stepData<SDIndex,STEP_PRODUCT$>			= Product
		stepData<SDIndex,STEP_PROCESS$>			= 'Epi Growth'
		stepData<SDIndex,STEP_SPEC_TOL$>		= SpecTol
		stepData<SDIndex,STEP_EVAL_MEAS$>		= ConMTool
		stepData<SDIndex,STEP_SIZE$>			= ConMType
		stepData<SDIndex,STEP_FREQ$>			= Frequency
		stepData<SDIndex,STEP_CTRL_METHOD$>		= OCONV(ConMSPC,'BSPC,WI')
		stepData<SDIndex,STEP_REACT_PLAN$>		= 'OCAP'
		
	END
	
	IF CResMTool NE '' THEN
		SDIndex += 1
	
		SWAP 'ê-cm'	WITH 'ohm.cm'	in CResUnits
		SWAP 'ê/Ü'	WITH 'ohm/sq'	in CResUnits
		
		IF CresMType = 'Prod' THEN CresMType = '1 Prod Wfr'
		
		Freq = ''
		IF CResMFirst	NE '' THEN Freq  = 'First, '
		IF CResMFreq		NE '' THEN Freq := CResMFreq:', '
		IF CResMLast		NE '' THEN Freq := 'Last'
		
		IF CResMSPC = '' THEN CResMSPC = '0'

		stepData<SDIndex,STEP_STEP$>			= SDIndex
		stepData<SDIndex,STEP_PROCESS_NAME$>	= 'Epitaxy Layer ':I
		stepData<SDIndex,STEP_MACHINE$>			= ReactorType
		stepData<SDIndex,STEP_PSN$>				= PSNo
		stepData<SDIndex,STEP_PRODUCT$>			= 'CRes'
		stepData<SDIndex,STEP_PROCESS$>			= 'Epi Growth'
		stepData<SDIndex,STEP_SPEC_TOL$>		= CResMin:' - ':CResMax:CResUnits
		stepData<SDIndex,STEP_EVAL_MEAS$>		= CResMTool
		stepData<SDIndex,STEP_SIZE$>			= CResMType
		stepData<SDIndex,STEP_FREQ$>			= CResMFreq
		stepData<SDIndex,STEP_CTRL_METHOD$>		= OCONV(CResMSPC,'BSPC,WI')
		stepData<SDIndex,STEP_REACT_PLAN$>		= 'OCAP'
		
	END
	
	
NEXT I

font<FONT_NAME$> = 'MS LineDraw'
font<FONT_SIZE$> = 8		;* 10 point
font<FONT_BOLD$> = 0		;* Bold
stat = Set_Printer('FONT',font)

stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,TB_ALL)

Font<FONT_BOLD$> = 0
Void = Set_Printer( 'FONT', Font )

stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,TB_ALL)

stat = Set_Printer('TEXT')

Sigs = ''

* Process Steps

colHeader = 'Step':@VM							; colFormat      = '^540':@VM
colHeader<1,2> = 'Process Name':@VM				; colFormat<1,2> = '<1440':@VM
colHeader<1,3> = 'Machine':@VM					; colFormat<1,3> = '<1080':@VM
colHeader<1,4> = 'PSN':@VM						; colFormat<1,4> = '^540':@VM
colHeader<1,5> = 'Product':@VM					; colFormat<1,5> = '^1440':@VM
colHeader<1,6> = 'Process':@VM					; colFormat<1,6> = '^1800':@VM
colHeader<1,7> = 'Spec Tolerance':@VM			; colFormat<1,7> = '<2160':@VM
colHeader<1,8> = 'Evaluation Meas':@VM			; colFormat<1,8> = '<1440':@VM
colHeader<1,9> = 'Size':@VM						; colFormat<1,9> = '^1080':@VM
colHeader<1,10> = 'Freq':@VM					; colFormat<1,10> = '^1080':@VM
colHeader<1,11> = 'Control':CRLF$:'Method'		; colFormat<1,11> = '^720'
colHeader<1,12> = 'React Plan'					; colFormat<1,12> = '^1080'

StepNo = 1

colData = ''
colData<StepNo,STEP_STEP$>			= StepNo
colData<StepNo,STEP_PROCESS_NAME$>	= 'Receiving'
colData<StepNo,STEP_MACHINE$>		= 'Paperwork'
colData<StepNo,STEP_PSN$>			= PSNo
colData<StepNo,STEP_PRODUCT$>		= 'Paperwork'
colData<StepNo,STEP_PROCESS$>		= 'Manual'
colData<StepNo,STEP_SPEC_TOL$>		= 'Consistent Data'
colData<StepNo,STEP_EVAL_MEAS$>		= 'Visual'
colData<StepNo,STEP_SIZE$>			= 'Shipment'
colData<StepNo,STEP_FREQ$>			= 'Per Cass'
colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
colData<StepNo,STEP_REACT_PLAN$>	= 'Pass/Fail'


* * Pre Epi Cleaning and Inspection * *

SCSubOxide		= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubOxide$>
SCAngstroms		= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubOxideAngstroms$>
SCTool			= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubPreClean$>
SCToolRecipe	= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubPreAkrionRecipe$>

IF SCTool[1,2] 			_EQC 'NO' THEN SCTool = ''
 
SBrightLight	= PSNRec<PROD_SPEC_PRE_BRIGHTLIGHT$>
SMicroscope		= PSNRec<PROD_SPEC_PRE_MICROSCOPE$>

SSurfscan		= PSNRec<PROD_SPEC_PRE_SURFSCAN$>
SSurfscanRecipe	= PSNRec<PROD_SPEC_PRE_SURFSCAN_RECIPE$>

* Sub Oxide Strip

IF SCSubOxide = 1 THEN
	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'HF Strip'
	colData<StepNo,STEP_MACHINE$>		= 'HF'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= 'SC-1'
	colData<StepNo,STEP_PROCESS$>		= '20min or Dewet'
	colData<StepNo,STEP_SPEC_TOL$>		= 'NA'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'HF'
	colData<StepNo,STEP_SIZE$>			= '1 Cass'
	colData<StepNo,STEP_FREQ$>			= 'All'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'

END

* Pre Clean - Done ******

IF  SCTool NE '' OR SCToolRecipe NE '' THEN

	IF SCTool = 'If Necessary'	THEN SCTool = 'Akrion'

	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Pre-epi Clean'
	colData<StepNo,STEP_MACHINE$>		= SCTool
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= 'Cleaning'
	colData<StepNo,STEP_PROCESS$>		= SCToolRecipe
	colData<StepNo,STEP_SPEC_TOL$>		= 'NA'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Visual'
	colData<StepNo,STEP_SIZE$>			= '1 Cass'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
	
END

* Pre Brightlight - Done *****

IF SBrightLight = 1 THEN

	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Pre-epi Insp'
	colData<StepNo,STEP_MACHINE$>		= 'Brightlight'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= CHAR(185):"LPD's"
	colData<StepNo,STEP_PROCESS$>		= 'Visual'
	colData<StepNo,STEP_SPEC_TOL$>		= '<':PSNRec<PROD_SPEC_PRE_LPD$>
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Brightlight'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
	
END

* Pre Microscope - Done *****

IF SMicroscope = 1 THEN

	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Pre-epi Insp'
	colData<StepNo,STEP_MACHINE$>		= 'Microscope'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= 'Surface Quality'
	colData<StepNo,STEP_PROCESS$>		= 'Visual'
	colData<StepNo,STEP_SPEC_TOL$>		= 'PSN:':PSNo:' - Surface Spec'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Microscope'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
	
END

* Pre Surface Scan - Done *****

IF SSurfscan = 1 OR SSurfscanRecipe NE '' THEN
	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Pre-epi Insp'
	colData<StepNo,STEP_MACHINE$>		= 'SurfScan'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= CHAR(185):"LPD's"
	colData<StepNo,STEP_PROCESS$>		= SSurfscanRecipe
	colData<StepNo,STEP_SPEC_TOL$>		= 'See Hard Copy Spec'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'SurfScan'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
END


FOR I = 1 TO SDIndex
	StepNo += 1
	colData<StepNo> = StepData<I>
	colData<StepNo,STEP_STEP$> = StepNo
NEXT I
	


* * First/Last Wafer Cleaning and Inspection * *

Spec_FWI_LWI	= PSNRec<PROD_SPEC_POST_FWI_LWI$>		;* FWI OR LWI

SCTool			= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubPostClean$>
SCToolRecipe	= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubPostAkrionRecipe$>

IF SCTool[1,2] 			_EQC 'NO' THEN SCTool = ''
IF SCToolRecipe[1,2] 	_EQC 'NO' THEN SCToolRecipe = ''

SBrightLight	= PSNRec<PROD_SPEC_FIRST_BRIGHTLIGHT$>
SMicroscope		= PSNRec<PROD_SPEC_FIRST_MICROSCOPE$>

SSurfscan		= PSNRec<PROD_SPEC_FIRST_SURFSCAN$>
SSurfscanRecipe	= PSNRec<PROD_SPEC_FIRST_SURFSCAN_RECIPE$>

* FirstWafer Brightlight - Done *****

IF Spec_FWI_LWI = 'LWI' THEN
	ProcessName = 'Last Wafer Insp'
END ELSE
	ProcessName = 'First Wafer Insp'
END

IF SBrightLight = 1 THEN

	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= ProcessName
	colData<StepNo,STEP_MACHINE$>		= 'Brightlight'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= CHAR(185):"LPD's"
	colData<StepNo,STEP_PROCESS$>		= 'Visual'
	colData<StepNo,STEP_SPEC_TOL$>		= '<':PSNRec<PROD_SPEC_POST_LPD$>
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Brightlight'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
END

* FirstWafer Microscope - Done *****

IF SMicroscope = 1 THEN

	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= ProcessName
	colData<StepNo,STEP_MACHINE$>		= 'Microscope'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= 'Surface Quality'
	colData<StepNo,STEP_PROCESS$>		= 'Visual'
	colData<StepNo,STEP_SPEC_TOL$>		= 'PSN:':PSNo:' - Surface Spec'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Microscope'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
END

* First SurfScan - Done *****

IF SSurfscan = 1 OR SSurfscanRecipe NE '' THEN
	
	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= ProcessName
	colData<StepNo,STEP_MACHINE$>		= 'SurfScan'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= CHAR(185):"LPD's"
	colData<StepNo,STEP_PROCESS$>		= SSurfscanRecipe  
	colData<StepNo,STEP_SPEC_TOL$>		= 'See Hard Copy Spec'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Surf Scan'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
	
END


* * Post Epi Cleaning and Inspection * *

SBrightLight	= PSNRec<PROD_SPEC_POST_CLEAN_BRIGHTLIGHT$>

SSurfscan		= PSNRec<PROD_SPEC_POST_CLEAN_SURFSCAN$>
SSurfscanRecipe	= PSNRec<PROD_SPEC_POST_CLEAN_SURFSCAN_RECIPE$>

SCTool			= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubPostClean$>
SCToolRecipe	= PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubPostAkrionRecipe$>

FirstLPDLimit	= PSNRec<PROD_SPEC_POST_LPD$>

* Post Cleaning - Done *****

IF  SCTool NE '' OR SCToolRecipe NE '' THEN

	
	IF SCTool = 'If Necessary'	THEN Process = 'Akrion'
	
	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Post-epi Clean'
	colData<StepNo,STEP_MACHINE$>		= SCTool
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= 'Cleaning'
	colData<StepNo,STEP_PROCESS$>		= SCToolRecipe
	colData<StepNo,STEP_SPEC_TOL$>		= 'NA'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Visual'
	colData<StepNo,STEP_SIZE$>			= '1 Cass'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
END


* Post Epi Brightlight - Done ****

IF SBrightLight	= 1 THEN

	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Post-epi Insp'
	colData<StepNo,STEP_MACHINE$>		= 'Brightlight'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= CHAR(185):"LPD's"
	colData<StepNo,STEP_PROCESS$>		= 'Visual'
	colData<StepNo,STEP_SPEC_TOL$>		= '<':FirstLPDLimit
	colData<StepNo,STEP_EVAL_MEAS$>		= 'Brightlight'
	colData<StepNo,STEP_SIZE$>			= '1 Prod Wfr'
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
END
	
* Post Epi SurfScan	- Not found below!

IF SSurfscan = 1 OR SSurfscanRecipe NE '' THEN
	StepNo += 1
	colData<StepNo,STEP_STEP$>			= StepNo
	colData<StepNo,STEP_PROCESS_NAME$>	= 'Post-epi Insp'
	colData<StepNo,STEP_MACHINE$>		= 'SurfScan'
	colData<StepNo,STEP_PSN$>			= PSNo
	colData<StepNo,STEP_PRODUCT$>		= CHAR(185):"LPD's"
	colData<StepNo,STEP_PROCESS$>		= SSurfscanRecipe
	colData<StepNo,STEP_SPEC_TOL$>		= 'See Hard Copy Spec'
	colData<StepNo,STEP_EVAL_MEAS$>		= 'SurfScan'
	colData<StepNo,STEP_SIZE$>			= PSNRec<PROD_SPEC_POST_CLEAN_SS_SAMP_QTY$>
	colData<StepNo,STEP_FREQ$>			= 'Per Cass'
	colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
	colData<StepNo,STEP_REACT_PLAN$>	= 'OCAP'
END

StepNo += 1
colData<StepNo,STEP_STEP$>			= StepNo
colData<StepNo,STEP_PROCESS_NAME$>	= 'Shipping'
colData<StepNo,STEP_MACHINE$>		= 'Paperwork'
colData<StepNo,STEP_PSN$>			= PSNo
colData<StepNo,STEP_PRODUCT$>		= 'Paperwork'
colData<StepNo,STEP_PROCESS$>		= 'Manual'
colData<StepNo,STEP_SPEC_TOL$>		= 'Consistent Data'
colData<StepNo,STEP_EVAL_MEAS$>		= 'Visual'
colData<StepNo,STEP_SIZE$>			= 'Shipment'
colData<StepNo,STEP_FREQ$>			= 'Per Cass'
colData<StepNo,STEP_CTRL_METHOD$>	= 'WI'
colData<StepNo,STEP_REACT_PLAN$>	= 'Pass/Fail'



Font = 'Arial'
Font<FONT_JUST$>		= 'L'
Font<FONT_SIZE$>		= 8
Font<FONT_UNDERLINE$>	= 0
Font<FONT_BOLD$>		= 0
Void = Set_Printer( 'FONT', Font )

stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,TB_ALL)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,TB_ALL)


***************************************************

stat		= Set_Printer("CALCTEXT",CHAR(185):'Note: Special Characteristics')
noteSize	= Get_Printer("CALCTEXT")
noteWidth 	= noteSize<1>
noteHeight 	= noteSize<2>


stat = Set_Printer('TEXT')
stat = Set_Printer('TEXT',CHAR(185):'Note: Special Characteristics')

stat = Set_Printer('TEXT')

SpecialInst = PSNRec<PROD_SPEC_SPEC_SUBSTRATE$,QSSubInstructions$>
ProveinInst = PSNRec<PROD_SPEC_SPEC_ADDTL$,QSAddProveInInst$>

SWAP @TM WITH CRLF$ IN SpecialInst
SWAP @TM WITH CRLF$ IN ProveInInst

colHeader	= 'Special Instructions'
colFmt		= '^14400'
colData		= SpecialInst

stat = Set_Printer('CALCTABLE',colFmt:@FM:colData)

TableSize	= Get_Printer('CALCTABLE')
TableHeight = TableSize<2>
CurrY = Get_Printer('POS')<2>

IF CurrY + noteHeight + TableHeight > MaxPrintHeight  THEN
	stat = Set_Printer('PAGEBREAK')
END

Font<2> = 10   
Font<4> = 0
Void = Set_Printer( 'FONT', Font )   

stat = Set_Printer('ADDTABLE', colFmt,colHeader,'',LTGREY$,'',0,TB_ALL)

colFmt = '<14400'
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',1,TB_ALL)

stat = Set_Printer('TEXT')

colHeader	= 'Prove-In Instructions'
colFmt		= '^14400'
colData		= ProveinInst

stat = Set_Printer('CALCTABLE',colFmt:@FM:colData)

TableSize	= Get_Printer('CALCTABLE')
TableHeight = TableSize<2>
CurrY = Get_Printer('POS')<2>

IF CurrY + noteHeight + TableHeight > MaxPrintHeight  THEN
	stat = Set_Printer('PAGEBREAK')
END


Font<2> = 10   
Font<4> = 0
Void = Set_Printer( 'FONT', Font )   

stat = Set_Printer('ADDTABLE', colFmt,colHeader,'',LTGREY$,colData,0,TB_ALL)

colFmt = '<14400'
stat = Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',1,TB_ALL)


stat = set_printer( 'TERM' )

RETURN




