compile subroutine rds_rpt1_prn( FromDate, ThruDate, Summary )

! 
* LIST RDS  ID-SUPP BREAK-ON REACTOR "'V'" JUSTLEN 7 BREAK-ON CUST_CITY "'V'" JUSTLEN 30 SCHEDULE_NO JUSTLEN 11 SEQ JUSTLEN 8 TOTAL WAFERS_IN TOTAL WFRS_OUT TOTAL LSL_PRE_EPI_REJ TOTAL LSL_POST_EPI_REJ TOTAL LSL_TOT_REJ TOTAL CUST_PRE_EPI_REJ TOTAL CUST_POST_EPI_REJ TOTAL CUST_TOT_REJ TOTAL TOT_REJ TIME_IN TIME_OUT TOTAL ELAPSED_HOURS DATE_IN DATE_OUT  OPERATOR_IN OPERATOR_OUT HEADING " Run Date: 'TS39'Page'P''LS17'Wafer Process History from 01/01/95 To 12/31/95"
! 
*PRINTLINE:=ER ON
declare function set_printer
* 
* HEADING/FOOTING
Font = 'Courier New,6,L,0'
convert ',' to @fm in Font
HeadPos = '.38/.88/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5/.5'
convert '/' to @fm in HeadPos
TheHeader = " Wafer Process History from (":oconv(FromDate, 'D2/'):") Thru (":oconv(ThruDate, 'D2/' ):')':" 'D' 'T' PAGE # 'P'":@fm
COLHEADER = "React" : @vm : "Customer" : @vm : "RDS" : @vm : "Wafers" : @vm : "Wafers" : @vm : "LSL" : @vm : "LSL" : @vm : "LSL" : @vm : "Cust" : @vm : "Cust" : @vm : "Cust" : @vm : "Total" : @vm : "Time" : @vm : "Time" : @vm : "Elapsed" : @vm : "Maint," : @vm: "Date" : @vm : "Date" : @vm : "Operat" : @vm : "Operat":@fm
COLHEADER:= "or":@vm:@vm:@vm:'In':@vm:'Out':@vm:"Pre":@vm:"Post":@vm:"Tot":@vm:"Pre":@vm:"Post":@vm:"Tot":@vm:"All":@vm:'In':@vm:'Out':@vm:'Hours':@vm:'Test,':@vm:"In":@vm:"Out":@vm:"or In":@vm:"or Out":@fm
COLHEADER:= @vm:@vm:@vm:@vm:@vm:"Epi":@vm:"Epi":@vm:"Rej":@vm:"Epi":@vm:"Epi":@vm:"Rej":@vm:"Rej":@vm:@vm:@vm:@vm:"Prove In":@vm:"":@vm:"":@vm:@vm:"":@fm
COLHEADER:= @vm:@vm:@vm:@vm:@vm:"Rej":@vm:"Rej":@vm:"":@vm:"Rej":@vm:"Rej":@vm:"":@vm:"":@vm:@vm:@vm:@vm:"Hours":@vm:"":@vm:"":@vm:@vm:"":@fm
COLHEADER:= str('_',9):@vm:str('_',16):@vm:str('_',8):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',8):@vm:str('_',8):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@vm:str('_',9):@fm
Void = set_printer( 'FONTHEADFOOT', Font )
Void = set_printer( 'HEADER', TheHeader, HeadPos, ColHeader )
Void = set_printer( 'FONT', Font )
*
*FOOTING ""
* 
@RECCOUNT=0
FIRST.PASS=1
LAST.RECORD=0
READERR=0
* 
* OPEN DICT AND DATA FILES
* 
OPEN "DICT","RDS" TO @DICT ELSE return
OPEN "","RDS" TO FILE.IN ELSE return
* 
* MAKE COLUMN HEADING
* 
*COLHEADING "Reactor" : @FM : "Customer/City" : @FM : "Schedule" : @FM : "RDS No" : @FM : "Wafers In" : @FM : "Wafers Out" : @FM : "LSLPreEPIRej" : @FM : "LSLPostEPIRej" : @FM : "LSLTotRej" : @FM : "CustPreEPIRej" : @FM : "CustPostEPIRej" : @FM : "CustTotRej" : @FM : "TotalAllRej" : @FM : "Time" : @FM : "Time" : @FM : "Elapsed" : @FM : "Date In" : @FM : "Date Out" : @FM : "Operator" : @FM : "Operator"
* 
* ZERO ACCUMULATORS FOR EACH BREAK
* 
WAFERSULIN.REACTOR.TOTAL=0
WAFERSULIN.REACTOR.COUNT=0
WAFERSULIN.CUSTULCITY.TOTAL=0
WAFERSULIN.CUSTULCITY.COUNT=0
WAFERSULIN.GRAND.TOTAL=0
WAFERSULIN.GRAND.COUNT=0
* 
WAFERSULOUT.REACTOR.TOTAL=0
WAFERSULOUT.REACTOR.COUNT=0
WAFERSULOUT.CUSTULCITY.TOTAL=0
WAFERSULOUT.CUSTULCITY.COUNT=0
WAFERSULOUT.GRAND.TOTAL=0
WAFERSULOUT.GRAND.COUNT=0
* 
LSLULPREULEPIULREJ.REACTOR.TOTAL=0
LSLULPREULEPIULREJ.REACTOR.COUNT=0
LSLULPREULEPIULREJ.CUSTULCITY.TOTAL=0
LSLULPREULEPIULREJ.CUSTULCITY.COUNT=0
LSLULPREULEPIULREJ.GRAND.TOTAL=0
LSLULPREULEPIULREJ.GRAND.COUNT=0
* 
LSLULPOSTULEPIULREJ.REACTOR.TOTAL=0
LSLULPOSTULEPIULREJ.REACTOR.COUNT=0
LSLULPOSTULEPIULREJ.CUSTULCITY.TOTAL=0
LSLULPOSTULEPIULREJ.CUSTULCITY.COUNT=0
LSLULPOSTULEPIULREJ.GRAND.TOTAL=0
LSLULPOSTULEPIULREJ.GRAND.COUNT=0
* 
LSLULTOTULREJ.REACTOR.TOTAL=0
LSLULTOTULREJ.REACTOR.COUNT=0
LSLULTOTULREJ.CUSTULCITY.TOTAL=0
LSLULTOTULREJ.CUSTULCITY.COUNT=0
LSLULTOTULREJ.GRAND.TOTAL=0
LSLULTOTULREJ.GRAND.COUNT=0
* 
CUSTULPREULEPIULREJ.REACTOR.TOTAL=0
CUSTULPREULEPIULREJ.REACTOR.COUNT=0
CUSTULPREULEPIULREJ.CUSTULCITY.TOTAL=0
CUSTULPREULEPIULREJ.CUSTULCITY.COUNT=0
CUSTULPREULEPIULREJ.GRAND.TOTAL=0
CUSTULPREULEPIULREJ.GRAND.COUNT=0
* 
CUSTULPOSTULEPIULREJ.REACTOR.TOTAL=0
CUSTULPOSTULEPIULREJ.REACTOR.COUNT=0
CUSTULPOSTULEPIULREJ.CUSTULCITY.TOTAL=0
CUSTULPOSTULEPIULREJ.CUSTULCITY.COUNT=0
CUSTULPOSTULEPIULREJ.GRAND.TOTAL=0
CUSTULPOSTULEPIULREJ.GRAND.COUNT=0
* 
CUSTULTOTULREJ.REACTOR.TOTAL=0
CUSTULTOTULREJ.REACTOR.COUNT=0
CUSTULTOTULREJ.CUSTULCITY.TOTAL=0
CUSTULTOTULREJ.CUSTULCITY.COUNT=0
CUSTULTOTULREJ.GRAND.TOTAL=0
CUSTULTOTULREJ.GRAND.COUNT=0
* 
TOTULREJ.REACTOR.TOTAL=0
TOTULREJ.REACTOR.COUNT=0
TOTULREJ.CUSTULCITY.TOTAL=0
TOTULREJ.CUSTULCITY.COUNT=0
TOTULREJ.GRAND.TOTAL=0
TOTULREJ.GRAND.COUNT=0
* 
ELAPSEDULHOURS.REACTOR.TOTAL=0
ELAPSEDULHOURS.REACTOR.COUNT=0
ELAPSEDULHOURS.CUSTULCITY.TOTAL=0
ELAPSEDULHOURS.CUSTULCITY.COUNT=0
ELAPSEDULHOURS.GRAND.TOTAL=0
ELAPSEDULHOURS.GRAND.COUNT=0
* 
MAINTULHOURS.REACTOR.TOTAL=0
MAINTULHOURS.REACTOR.COUNT=0
MAINTULHOURS.CUSTULCITY.TOTAL=0
MAINTULHOURS.CUSTULCITY.COUNT=0
MAINTULHOURS.GRAND.TOTAL=0
MAINTULHOURS.GRAND.COUNT=0

* NULL PREVIOUS BREAK BUCKETS
* 
PREV.REACTOR=''
LAST.REACTOR.BREAK = 1
PREV.CUSTULCITY=''
LAST.CUSTULCITY.BREAK = 1
* 
! 
READRECORD:
! 
* 
* 
* ZERO BREAK FLAGS TO FALSE
* 
REACTOR.BREAK=0
CUSTULCITY.BREAK=0
* 
* 
@FILE.ERROR.MODE=1
READNEXT @ID,WHICH.VALUE ELSE
@FILE.ERROR.MODE=0
IF STATUS() GT 0 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_5} )
return
END
IF @FILE.ERROR<1> EQ 421 THEN
Void = set_printer( 'TEXT', {RLIST_TEXT_6} )
GOTO READRECORD
END
IF @FILE.ERROR<1> NE 111 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT',  {RLIST_TEXT_4} )
READERR+=1
GOTO READRECORD
END
LAST.RECORD=1
REACTOR.BREAK=1
REACTOR=PREV.REACTOR
CUSTULCITY.BREAK=1
CUSTULCITY=PREV.CUSTULCITY
END
@FILE.ERROR.MODE=0
* 
S.ATID=@ID
* 
IF FIRST.PASS AND LAST.RECORD THEN
Void = set_printer( 'TEXT', {RLIST_TEXT_2} )
return
END
* 
IF LAST.RECORD THEN GOTO BREAKS
* 
IF @REDUCTION.DONE THEN
@FILE.ERROR.MODE=1
READO @RECORD FROM FILE.IN,@ID ELSE
@FILE.ERROR.MODE=0
IF STATUS() GT 0 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_5} )
return
END
IF @FILE.ERROR<1> NE 100 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_4} )
READERR+=1
END
GOTO READRECORD
END
@FILE.ERROR.MODE=0
END
* 
@RECCOUNT+=1
* 
* 
* CALCULATE VALUE(S) FOR COLUMN(S)
* 
S.ATID={@ID}
I.ATID=S.ATID
S.REACTOR={REACTOR}
I.REACTOR=S.REACTOR
S.CUSTULCITY={ABBREV_OR_CO_NAME}
I.CUSTULCITY=S.CUSTULCITY
S.SCHEDULEULNO={SCHEDULE_NO}
I.SCHEDULEULNO=S.SCHEDULEULNO
S.SEQ={SEQ}
I.SEQ=S.SEQ
S.WAFERSULIN={WAFERS_IN}
I.WAFERSULIN=S.WAFERSULIN
S.WAFERSULOUT={WFRS_OUT}
I.WAFERSULOUT=S.WAFERSULOUT
S.LSLULPREULEPIULREJ={LSL_PRE_EPI_REJ}
I.LSLULPREULEPIULREJ=S.LSLULPREULEPIULREJ
S.LSLULPOSTULEPIULREJ={LSL_POST_EPI_REJ}
I.LSLULPOSTULEPIULREJ=S.LSLULPOSTULEPIULREJ
S.LSLULTOTULREJ={LSL_TOT_REJ}
I.LSLULTOTULREJ=S.LSLULTOTULREJ
S.CUSTULPREULEPIULREJ={CUST_PRE_EPI_REJ}
I.CUSTULPREULEPIULREJ=S.CUSTULPREULEPIULREJ
S.CUSTULPOSTULEPIULREJ={CUST_POST_EPI_REJ}
I.CUSTULPOSTULEPIULREJ=S.CUSTULPOSTULEPIULREJ
S.CUSTULTOTULREJ={CUST_TOT_REJ}
I.CUSTULTOTULREJ=S.CUSTULTOTULREJ
S.TOTULREJ={TOT_REJ}
I.TOTULREJ=S.TOTULREJ
S.TIMEULIN={TIME_IN}
I.TIMEULIN=S.TIMEULIN
S.TIMEULOUT={TIME_OUT}
I.TIMEULOUT=S.TIMEULOUT
S.ELAPSEDULHOURS={ELAPSED_HOURS}
I.ELAPSEDULHOURS=S.ELAPSEDULHOURS
S.MAINTULHOURS={MAINT_HOURS}
I.MAINTULHOURS=S.MAINTULHOURS
S.DATEULIN={DATE_IN}
I.DATEULIN=S.DATEULIN
S.DATEULOUT={DATE_OUT}
I.DATEULOUT=S.DATEULOUT
S.OPERATORULIN={OPERATOR_IN}
I.OPERATORULIN=S.OPERATORULIN
S.OPERATORULOUT={OPERATOR_OUT}
I.OPERATORULOUT=S.OPERATORULOUT
* 
* 
* TEST FOR CONTROL BREAK(S)
* 
IF (S.REACTOR NE PREV.REACTOR) OR REACTOR.BREAK THEN
REACTOR=PREV.REACTOR
PREV.REACTOR=S.REACTOR
REACTOR.BREAK+=1
CUSTULCITY.BREAK=3
END
* 
IF (S.CUSTULCITY NE PREV.CUSTULCITY) OR CUSTULCITY.BREAK THEN
CUSTULCITY=PREV.CUSTULCITY
PREV.CUSTULCITY=S.CUSTULCITY
CUSTULCITY.BREAK+=1
END
* 
* 
IF FIRST.PASS THEN
FIRST.PASS=0
GOTO DETAIL
END
* 
* 
! 
BREAKS:
! 
* 
* PRINT BREAK TOTAL(S) AND ACCUMULATE TOTAL(S)
* 
* 
IF CUSTULCITY.BREAK THEN
Void = set_printer( 'TEXT', '' )
PRINTLINE = "":@vm
PRINTLINE:= CUSTULCITY:@vm
PRINTLINE:= '':@vm
PRINTLINE:= OCONV(WAFERSULIN.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(WAFERSULOUT.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULPREULEPIULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULPOSTULEPIULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULTOTULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULPREULEPIULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULPOSTULEPIULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULTOTULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(TOTULREJ.CUSTULCITY.TOTAL ,"MD0"):@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= OCONV(ELAPSEDULHOURS.CUSTULCITY.TOTAL ,"MD2"):@vm
PRINTLINE:= OCONV(MAINTULHOURS.CUSTULCITY.TOTAL, "MD2"):@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
TableColInfo = '>+547':@vm:'<+1267':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm
TableColInfo:= '>+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'<+720':@vm:'<+720'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE ) 

Void = set_printer( 'TEXT', '' )
* 
WAFERSULIN.REACTOR.TOTAL+=WAFERSULIN.CUSTULCITY.TOTAL
WAFERSULIN.CUSTULCITY.TOTAL=0
WAFERSULIN.REACTOR.COUNT+=WAFERSULIN.CUSTULCITY.COUNT
WAFERSULIN.CUSTULCITY.COUNT=0
WAFERSULOUT.REACTOR.TOTAL+=WAFERSULOUT.CUSTULCITY.TOTAL
WAFERSULOUT.CUSTULCITY.TOTAL=0
WAFERSULOUT.REACTOR.COUNT+=WAFERSULOUT.CUSTULCITY.COUNT
WAFERSULOUT.CUSTULCITY.COUNT=0
LSLULPREULEPIULREJ.REACTOR.TOTAL+=LSLULPREULEPIULREJ.CUSTULCITY.TOTAL
LSLULPREULEPIULREJ.CUSTULCITY.TOTAL=0
LSLULPREULEPIULREJ.REACTOR.COUNT+=LSLULPREULEPIULREJ.CUSTULCITY.COUNT
LSLULPREULEPIULREJ.CUSTULCITY.COUNT=0
LSLULPOSTULEPIULREJ.REACTOR.TOTAL+=LSLULPOSTULEPIULREJ.CUSTULCITY.TOTAL
LSLULPOSTULEPIULREJ.CUSTULCITY.TOTAL=0
LSLULPOSTULEPIULREJ.REACTOR.COUNT+=LSLULPOSTULEPIULREJ.CUSTULCITY.COUNT
LSLULPOSTULEPIULREJ.CUSTULCITY.COUNT=0
LSLULTOTULREJ.REACTOR.TOTAL+=LSLULTOTULREJ.CUSTULCITY.TOTAL
LSLULTOTULREJ.CUSTULCITY.TOTAL=0
LSLULTOTULREJ.REACTOR.COUNT+=LSLULTOTULREJ.CUSTULCITY.COUNT
LSLULTOTULREJ.CUSTULCITY.COUNT=0
CUSTULPREULEPIULREJ.REACTOR.TOTAL+=CUSTULPREULEPIULREJ.CUSTULCITY.TOTAL
CUSTULPREULEPIULREJ.CUSTULCITY.TOTAL=0
CUSTULPREULEPIULREJ.REACTOR.COUNT+=CUSTULPREULEPIULREJ.CUSTULCITY.COUNT
CUSTULPREULEPIULREJ.CUSTULCITY.COUNT=0
CUSTULPOSTULEPIULREJ.REACTOR.TOTAL+=CUSTULPOSTULEPIULREJ.CUSTULCITY.TOTAL
CUSTULPOSTULEPIULREJ.CUSTULCITY.TOTAL=0
CUSTULPOSTULEPIULREJ.REACTOR.COUNT+=CUSTULPOSTULEPIULREJ.CUSTULCITY.COUNT
CUSTULPOSTULEPIULREJ.CUSTULCITY.COUNT=0
CUSTULTOTULREJ.REACTOR.TOTAL+=CUSTULTOTULREJ.CUSTULCITY.TOTAL
CUSTULTOTULREJ.CUSTULCITY.TOTAL=0
CUSTULTOTULREJ.REACTOR.COUNT+=CUSTULTOTULREJ.CUSTULCITY.COUNT
CUSTULTOTULREJ.CUSTULCITY.COUNT=0
TOTULREJ.REACTOR.TOTAL+=TOTULREJ.CUSTULCITY.TOTAL
TOTULREJ.CUSTULCITY.TOTAL=0
TOTULREJ.REACTOR.COUNT+=TOTULREJ.CUSTULCITY.COUNT
TOTULREJ.CUSTULCITY.COUNT=0
ELAPSEDULHOURS.REACTOR.TOTAL+=ELAPSEDULHOURS.CUSTULCITY.TOTAL
ELAPSEDULHOURS.CUSTULCITY.TOTAL=0
ELAPSEDULHOURS.REACTOR.COUNT+=ELAPSEDULHOURS.CUSTULCITY.COUNT
ELAPSEDULHOURS.CUSTULCITY.COUNT=0
MAINTULHOURS.REACTOR.TOTAL+=MAINTULHOURS.CUSTULCITY.TOTAL
MAINTULHOURS.CUSTULCITY.TOTAL=0
MAINTULHOURS.REACTOR.COUNT+=MAINTULHOURS.CUSTULCITY.COUNT
MAINTULHOURS.CUSTULCITY.COUNT=0
END
* 
IF REACTOR.BREAK THEN
Void = set_printer( 'TEXT', '' )
PRINTLINE = REACTOR:@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= OCONV(WAFERSULIN.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(WAFERSULOUT.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULPREULEPIULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULPOSTULEPIULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULTOTULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULPREULEPIULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULPOSTULEPIULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULTOTULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(TOTULREJ.REACTOR.TOTAL ,"MD0"):@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= OCONV(ELAPSEDULHOURS.REACTOR.TOTAL ,"MD2"):@vm
PRINTLINE:= OCONV(MAINTULHOURS.REACTOR.TOTAL, "MD2"):@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
TableColInfo = '>+547':@vm:'<+1267':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm
TableColInfo:= '>+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'<+720':@vm:'<+720'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE ) 

Void = set_printer( 'TEXT', '' )
* 
WAFERSULIN.GRAND.TOTAL+=WAFERSULIN.REACTOR.TOTAL
WAFERSULIN.REACTOR.TOTAL=0
WAFERSULIN.GRAND.COUNT+=WAFERSULIN.REACTOR.COUNT
WAFERSULIN.REACTOR.COUNT=0
WAFERSULOUT.GRAND.TOTAL+=WAFERSULOUT.REACTOR.TOTAL
WAFERSULOUT.REACTOR.TOTAL=0
WAFERSULOUT.GRAND.COUNT+=WAFERSULOUT.REACTOR.COUNT
WAFERSULOUT.REACTOR.COUNT=0
LSLULPREULEPIULREJ.GRAND.TOTAL+=LSLULPREULEPIULREJ.REACTOR.TOTAL
LSLULPREULEPIULREJ.REACTOR.TOTAL=0
LSLULPREULEPIULREJ.GRAND.COUNT+=LSLULPREULEPIULREJ.REACTOR.COUNT
LSLULPREULEPIULREJ.REACTOR.COUNT=0
LSLULPOSTULEPIULREJ.GRAND.TOTAL+=LSLULPOSTULEPIULREJ.REACTOR.TOTAL
LSLULPOSTULEPIULREJ.REACTOR.TOTAL=0
LSLULPOSTULEPIULREJ.GRAND.COUNT+=LSLULPOSTULEPIULREJ.REACTOR.COUNT
LSLULPOSTULEPIULREJ.REACTOR.COUNT=0
LSLULTOTULREJ.GRAND.TOTAL+=LSLULTOTULREJ.REACTOR.TOTAL
LSLULTOTULREJ.REACTOR.TOTAL=0
LSLULTOTULREJ.GRAND.COUNT+=LSLULTOTULREJ.REACTOR.COUNT
LSLULTOTULREJ.REACTOR.COUNT=0
CUSTULPREULEPIULREJ.GRAND.TOTAL+=CUSTULPREULEPIULREJ.REACTOR.TOTAL
CUSTULPREULEPIULREJ.REACTOR.TOTAL=0
CUSTULPREULEPIULREJ.GRAND.COUNT+=CUSTULPREULEPIULREJ.REACTOR.COUNT
CUSTULPREULEPIULREJ.REACTOR.COUNT=0
CUSTULPOSTULEPIULREJ.GRAND.TOTAL+=CUSTULPOSTULEPIULREJ.REACTOR.TOTAL
CUSTULPOSTULEPIULREJ.REACTOR.TOTAL=0
CUSTULPOSTULEPIULREJ.GRAND.COUNT+=CUSTULPOSTULEPIULREJ.REACTOR.COUNT
CUSTULPOSTULEPIULREJ.REACTOR.COUNT=0
CUSTULTOTULREJ.GRAND.TOTAL+=CUSTULTOTULREJ.REACTOR.TOTAL
CUSTULTOTULREJ.REACTOR.TOTAL=0
CUSTULTOTULREJ.GRAND.COUNT+=CUSTULTOTULREJ.REACTOR.COUNT
CUSTULTOTULREJ.REACTOR.COUNT=0
TOTULREJ.GRAND.TOTAL+=TOTULREJ.REACTOR.TOTAL
TOTULREJ.REACTOR.TOTAL=0
TOTULREJ.GRAND.COUNT+=TOTULREJ.REACTOR.COUNT
TOTULREJ.REACTOR.COUNT=0
ELAPSEDULHOURS.GRAND.TOTAL+=ELAPSEDULHOURS.REACTOR.TOTAL
ELAPSEDULHOURS.REACTOR.TOTAL=0
ELAPSEDULHOURS.GRAND.COUNT+=ELAPSEDULHOURS.REACTOR.COUNT
ELAPSEDULHOURS.REACTOR.COUNT=0
MAINTULHOURS.GRAND.TOTAL+=MAINTULHOURS.REACTOR.TOTAL
MAINTULHOURS.REACTOR.TOTAL=0
MAINTULHOURS.GRAND.COUNT+=MAINTULHOURS.REACTOR.COUNT
MAINTULHOURS.REACTOR.COUNT=0
END
* 
* PERFORM LAST RECORD OUTPUT IF DONE
* 
IF LAST.RECORD THEN
Void = set_printer( 'TEXT', '' )
PRINTLINE= "***":@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= OCONV(WAFERSULIN.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(WAFERSULOUT.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULPREULEPIULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULPOSTULEPIULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(LSLULTOTULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULPREULEPIULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULPOSTULEPIULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(CUSTULTOTULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= OCONV(TOTULREJ.GRAND.TOTAL ,"MD0"):@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= OCONV(ELAPSEDULHOURS.GRAND.TOTAL ,"MD2"):@vm
PRINTLINE:= OCONV(MAINTULHOURS.GRAND.TOTAL ,"MD2"):@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
PRINTLINE:= '':@vm
TableColInfo = '>+547':@vm:'<+1267':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm
TableColInfo:= '>+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'<+720':@vm:'<+720'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE ) 

* PRINTLINE:=
* @ANS=@RECCOUNT
* PRINTLINE:= {RLIST_TEXT_1}
IF READERR THEN
@ANS=READERR
PRINTLINE:= {RLIST_TEXT_3}
END
return
END
* 
! 
DETAIL:
! 
* 
* DO CONVERSIONS IF ANY
* 
IF S.SCHEDULEULNO NE "" THEN S.SCHEDULEULNO=OCONV(S.SCHEDULEULNO,"MD0")
IF S.SEQ NE "" THEN S.SEQ=OCONV(S.SEQ,"MD0")
IF S.WAFERSULIN NE "" THEN S.WAFERSULIN=OCONV(S.WAFERSULIN,"MD0")
IF S.WAFERSULOUT NE "" THEN S.WAFERSULOUT=OCONV(S.WAFERSULOUT,"MD0")
IF S.LSLULPREULEPIULREJ NE "" THEN S.LSLULPREULEPIULREJ=OCONV(S.LSLULPREULEPIULREJ,"MD0")
IF S.LSLULPOSTULEPIULREJ NE "" THEN S.LSLULPOSTULEPIULREJ=OCONV(S.LSLULPOSTULEPIULREJ,"MD0")
IF S.LSLULTOTULREJ NE "" THEN S.LSLULTOTULREJ=OCONV(S.LSLULTOTULREJ,"MD0")
IF S.CUSTULPREULEPIULREJ NE "" THEN S.CUSTULPREULEPIULREJ=OCONV(S.CUSTULPREULEPIULREJ,"MD0")
IF S.CUSTULPOSTULEPIULREJ NE "" THEN S.CUSTULPOSTULEPIULREJ=OCONV(S.CUSTULPOSTULEPIULREJ,"MD0")
IF S.CUSTULTOTULREJ NE "" THEN S.CUSTULTOTULREJ=OCONV(S.CUSTULTOTULREJ,"MD0")
IF S.TOTULREJ NE "" THEN S.TOTULREJ=OCONV(S.TOTULREJ,"MD0")
IF S.TIMEULIN NE "" THEN S.TIMEULIN=OCONV(S.TIMEULIN,"MTH")
IF S.TIMEULOUT NE "" THEN S.TIMEULOUT=OCONV(S.TIMEULOUT,"MTH")
IF S.ELAPSEDULHOURS NE "" THEN S.ELAPSEDULHOURS=OCONV(S.ELAPSEDULHOURS,"MD2")
IF S.MAINTULHOURS NE "" THEN S.MAINTULHOURS=OCONV(S.MAINTULHOURS,"MD2")
IF S.DATEULIN NE "" THEN S.DATEULIN=OCONV(S.DATEULIN,"D2/")
IF S.DATEULOUT NE "" THEN S.DATEULOUT=OCONV(S.DATEULOUT,"D2/")
IF S.OPERATORULIN NE "" THEN S.OPERATORULIN=OCONV(S.OPERATORULIN,"[XLATE_CONV,LSL_USERS*FIRST_LAST]")
IF S.OPERATORULOUT NE "" THEN S.OPERATORULOUT=OCONV(S.OPERATORULOUT,"[XLATE_CONV,LSL_USERS*FIRST_LAST]")
* 
* ACCUMULATE TOTAL(S)
* 
IF NUM(I.WAFERSULIN) AND I.WAFERSULIN NE "" THEN
WAFERSULIN.CUSTULCITY.TOTAL+=I.WAFERSULIN
WAFERSULIN.CUSTULCITY.COUNT+=1
I.WAFERSULIN=''
END
IF NUM(I.WAFERSULOUT) AND I.WAFERSULOUT NE "" THEN
WAFERSULOUT.CUSTULCITY.TOTAL+=I.WAFERSULOUT
WAFERSULOUT.CUSTULCITY.COUNT+=1
I.WAFERSULOUT=''
END
IF NUM(I.LSLULPREULEPIULREJ) AND I.LSLULPREULEPIULREJ NE "" THEN
LSLULPREULEPIULREJ.CUSTULCITY.TOTAL+=I.LSLULPREULEPIULREJ
LSLULPREULEPIULREJ.CUSTULCITY.COUNT+=1
I.LSLULPREULEPIULREJ=''
END
IF NUM(I.LSLULPOSTULEPIULREJ) AND I.LSLULPOSTULEPIULREJ NE "" THEN
LSLULPOSTULEPIULREJ.CUSTULCITY.TOTAL+=I.LSLULPOSTULEPIULREJ
LSLULPOSTULEPIULREJ.CUSTULCITY.COUNT+=1
I.LSLULPOSTULEPIULREJ=''
END
IF NUM(I.LSLULTOTULREJ) AND I.LSLULTOTULREJ NE "" THEN
LSLULTOTULREJ.CUSTULCITY.TOTAL+=I.LSLULTOTULREJ
LSLULTOTULREJ.CUSTULCITY.COUNT+=1
I.LSLULTOTULREJ=''
END
IF NUM(I.CUSTULPREULEPIULREJ) AND I.CUSTULPREULEPIULREJ NE "" THEN
CUSTULPREULEPIULREJ.CUSTULCITY.TOTAL+=I.CUSTULPREULEPIULREJ
CUSTULPREULEPIULREJ.CUSTULCITY.COUNT+=1
I.CUSTULPREULEPIULREJ=''
END
IF NUM(I.CUSTULPOSTULEPIULREJ) AND I.CUSTULPOSTULEPIULREJ NE "" THEN
CUSTULPOSTULEPIULREJ.CUSTULCITY.TOTAL+=I.CUSTULPOSTULEPIULREJ
CUSTULPOSTULEPIULREJ.CUSTULCITY.COUNT+=1
I.CUSTULPOSTULEPIULREJ=''
END
IF NUM(I.CUSTULTOTULREJ) AND I.CUSTULTOTULREJ NE "" THEN
CUSTULTOTULREJ.CUSTULCITY.TOTAL+=I.CUSTULTOTULREJ
CUSTULTOTULREJ.CUSTULCITY.COUNT+=1
I.CUSTULTOTULREJ=''
END
IF NUM(I.TOTULREJ) AND I.TOTULREJ NE "" THEN
TOTULREJ.CUSTULCITY.TOTAL+=I.TOTULREJ
TOTULREJ.CUSTULCITY.COUNT+=1
I.TOTULREJ=''
END
IF NUM(I.ELAPSEDULHOURS) AND I.ELAPSEDULHOURS NE "" THEN
ELAPSEDULHOURS.CUSTULCITY.TOTAL+=I.ELAPSEDULHOURS
ELAPSEDULHOURS.CUSTULCITY.COUNT+=1
I.ELAPSEDULHOURS=''
END
IF NUM(I.MAINTULHOURS) AND I.MAINTULHOURS NE "" THEN
MAINTULHOURS.CUSTULCITY.TOTAL+=I.MAINTULHOURS
MAINTULHOURS.CUSTULCITY.COUNT+=1
I.MAINTULHOURS=''
END

* 
* PRINTLINE:= DETAIL LINE
if Summary else
	* 
	PRINTLINE = S.REACTOR:@vm
	PRINTLINE:= S.CUSTULCITY:@vm
	PRINTLINE:= FMT( S.SEQ, 'R#7' ):@vm
	PRINTLINE:= S.WAFERSULIN:@vm
	PRINTLINE:= S.WAFERSULOUT:@vm
	PRINTLINE:= S.LSLULPREULEPIULREJ:@vm
	PRINTLINE:= S.LSLULPOSTULEPIULREJ:@vm
	PRINTLINE:= S.LSLULTOTULREJ:@vm
	PRINTLINE:= S.CUSTULPREULEPIULREJ:@vm
	PRINTLINE:= S.CUSTULPOSTULEPIULREJ:@vm
	PRINTLINE:= S.CUSTULTOTULREJ:@vm
	PRINTLINE:= S.TOTULREJ:@vm
	PRINTLINE:= S.TIMEULIN:@vm
	PRINTLINE:= S.TIMEULOUT:@vm
	PRINTLINE:= S.ELAPSEDULHOURS:@vm
	PRINTLINE:= S.MAINTULHOURS:@vm
	PRINTLINE:= S.DATEULIN:@vm
	PRINTLINE:= S.DATEULOUT:@vm
	PRINTLINE:= S.OPERATORULIN:@vm
	PRINTLINE:= S.OPERATORULOUT
	TableColInfo = '>+547':@vm:'<+1267':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm:'>+720':@vm
	TableColInfo:= '>+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'>+720':@vm:'>+720':@vm:'<+720':@vm:'<+720':@vm:'<+720':@vm:'<+720'
	Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE ) 
	* 
end
GOTO READRECORD
* 
END

