compile subroutine wo_log_rpt1_prn( Dummy )
! 
* LIST WO_LOG ID-SUPP WO JUSTLEN 6 CUST_NO JUSTLEN 6 COLHEAD 'CustNo' ABBREV_OR_CO_NAME JUSTLEN 18 PROD_SPEC_ID JUSTLEN 5 THICK_TARGET_L1 JUSTLEN 5 COLHEAD 'Thick' RES_TARGET_L1 JUSTLEN 5 COLHEAD 'Res' WAFER_INCHES JUSTLEN 4 QTY JUSTLEN 4 CUST_SHIP_DATE JUSTLEN 8 COLHEAD 'Ship Req' RECEIVED_DATE JUSTLEN 8 REACTORS JUSTLEN 5 COLHEAD 'R#(s)' SCHEDULED JUSTLEN 3 COLHEAD 'Sch' CLOSE_DATE JUSTLEN 8  HEADING " Run Date: 'TS59'Page'P''LS32'Work Order Log Report by WO# "
! 
*PRINTER ON
$insert oiprint_equates
declare function set_printer
Font = 'Times New Roman,9,L,0'
convert ',' to @fm in Font
HeadPos = '.56/.38/1.06/.38/.63/.56/.5/.5/.63/.63/.75/.31/.63'
convert '/' to @fm in HeadPos
*TheHeader = " Work Order Log Report by WO# 'D' 'T' PAGE # 'P'":@fm
TheHeader = ''
COLHEADER = "WO#" : @vm : "CNo" : @vm : "Customer" : @vm : "PSN" : @vm : "Thick" : @vm : "Res" : @vm : "Inch" : @vm : "Qty" : @vm : "Ship Req" : @vm : "Received" : @vm : "Reactor#" : @vm : "Sch" : @vm : "Close"
*COLHEADER:= "" : @vm : "" : @vm : "" : @vm : "" : @vm : "" : @vm : "" : @vm : "" : @vm : "" : @vm : "" : @vm : "Date" : @vm : "" : @vm : "" : @vm : "Date":@fm
*COLHEADER:= str('_',7):@vm:str('_',5):@vm:str('_',10):@vm:str('_',5):@vm:str('_',5):@vm:str('_',5):@vm:str('_',5):@vm:str('_',5):@vm:str('_',5):@vm:str('_',5):@vm:str('_',5):@vm:str('_',3):@vm:str('_',5)
HeadFont = Font
HeadFont<3> = 'C'
HeadFont<4> = 1
ColJusts = 'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C':@fm:'C'
Void = set_printer( 'FONTHEADFOOT', HeadFont )
Void = set_printer( 'HEADER', TheHeader, HeadPos, ColHeader, ColJusts )
Void = set_printer( 'FONT', Font )
* 
@RECCOUNT=0
FIRST.PASS=1
LAST.RECORD=0
READERR=0
* 
* OPEN DICT AND DATA FILES
* 
OPEN "DICT","WO_LOG" TO @DICT ELSE return
OPEN "","WO_LOG" TO FILE.IN ELSE return
*RowsPrinted = 0
* 
* MAKE COLUMN HEADING
* 
! 
READRECORD:
! 
* 
* 
@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
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.WO={WO}
I.WO=S.WO
S.CUSTULNO={CUST_NO}
I.CUSTULNO=S.CUSTULNO
S.ABBREVULORULCOULNAME={ABBREV_OR_CO_NAME}
I.ABBREVULORULCOULNAME=S.ABBREVULORULCOULNAME
S.PRODULSPECULID={PROD_SPEC_ID}
I.PRODULSPECULID=S.PRODULSPECULID
S.THICKULTARGETULLONE={THICK_TARGET_L1}
I.THICKULTARGETULLONE=S.THICKULTARGETULLONE
S.RESULTARGETULLONE={RES_TARGET_L1}
I.RESULTARGETULLONE=S.RESULTARGETULLONE
S.WAFERULINCHES={WAFER_INCHES}
I.WAFERULINCHES=S.WAFERULINCHES
S.QTY={QTY}
I.QTY=S.QTY
S.CUSTULSHIPULDATE={CUST_SHIP_DATE}
I.CUSTULSHIPULDATE=S.CUSTULSHIPULDATE
S.RECEIVEDULDATE={RECEIVED_DATE}
I.RECEIVEDULDATE=S.RECEIVEDULDATE
*M.REACTORS={REACTORS}<1,WHICH.VALUE> ; P.REACTORS=1 ; C.REACTORS=7
*REMOVED ABOVE CAUSE RICK DID NOT WANT TO SEE MULTI LINED SO CONVERT TO ','
M.REACTORS = {REACTORS_ONE_LINE} ; P.REACTORS=1 ; C.REACTORS=7
* THIS MAKES THE CHECK FOR MULTI VALUE BELOW OBSOLETE WHERE IT DOES A REMOVE
* BUT WILL NOT HURT ANYTHING TO KEEP IT
* OK 
S.SCHEDULED={SCHEDULED}
I.SCHEDULED=S.SCHEDULED
S.CLOSEULDATE={CLOSE_DATE}
I.CLOSEULDATE=S.CLOSEULDATE
* 
PREVIOUS.MARK.LEVEL=0
* 
IF FIRST.PASS THEN
FIRST.PASS=0
GOTO DETAIL
END
* 
* 
! 
BREAKS:
! 
* 
* 
* PERFORM LAST RECORD OUTPUT IF DONE
* 
IF LAST.RECORD THEN
* PRINT
* @ANS=@REC.COUNT
* Void = set_printer( 'TEXT', {RLIST_TEXT_1} )
IF READERR THEN
@ANS=READERR
Void = set_printer( 'TEXT', {RLIST_TEXT_3} )
END
return
END
* 
! 
DETAIL:
! 
* 
* REMOVE APPROPRIATE VALUE FROM MULTI-VALUED COLUMN(S)
* 
NEW.MARK.LEVEL=0
* 
IF C.REACTORS GE PREVIOUS.MARK.LEVEL THEN
REMOVE I.REACTORS FROM M.REACTORS AT P.REACTORS SETTING C.REACTORS
S.REACTORS=I.REACTORS
END
IF C.REACTORS GT NEW.MARK.LEVEL THEN NEW.MARK.LEVEL=C.REACTORS
* 
* DO CONVERSIONS IF ANY
* 
IF S.WO NE "" THEN S.WO=OCONV(S.WO,"MD0")
IF S.PRODULSPECULID NE "" THEN S.PRODULSPECULID=OCONV(S.PRODULSPECULID,"MD0")
IF S.THICKULTARGETULLONE NE "" THEN S.THICKULTARGETULLONE=OCONV(S.THICKULTARGETULLONE,"MD2")
IF S.RESULTARGETULLONE NE "" THEN S.RESULTARGETULLONE=OCONV(S.RESULTARGETULLONE,"MD3")
IF S.QTY NE "" THEN S.QTY=OCONV(S.QTY,"MD0")
IF S.CUSTULSHIPULDATE NE "" THEN S.CUSTULSHIPULDATE=OCONV(S.CUSTULSHIPULDATE,"D2/")
IF S.RECEIVEDULDATE NE "" THEN S.RECEIVEDULDATE=OCONV(S.RECEIVEDULDATE,"D2/")
IF S.REACTORS NE "" THEN S.REACTORS=OCONV(S.REACTORS,"MD0")
IF S.SCHEDULED NE "" THEN S.SCHEDULED=OCONV(S.SCHEDULED,"BX ")
IF S.CLOSEULDATE NE "" THEN S.CLOSEULDATE=OCONV(S.CLOSEULDATE,"D2/")
* 
* PRINT DETAIL LINE
*
*if RowsPrinted = 50 then
*   RowsPrinted = 0
*   Void = set_printer( 'PAGEBREAK' )
*end 
PRINTLINE = S.WO:@vm
PRINTLINE:= S.CUSTULNO:@vm
PRINTLINE:= S.ABBREVULORULCOULNAME:@vm
PRINTLINE:= S.PRODULSPECULID:@vm
PRINTLINE:= S.THICKULTARGETULLONE:@vm
PRINTLINE:= S.RESULTARGETULLONE:@vm
PRINTLINE:= S.WAFERULINCHES:@vm
PRINTLINE:= S.QTY:@vm
PRINTLINE:= S.CUSTULSHIPULDATE:@vm
PRINTLINE:= S.RECEIVEDULDATE:@vm
PRINTLINE:= S.REACTORS:@vm
PRINTLINE:= S.SCHEDULED:@vm
PRINTLINE:= S.CLOSEULDATE
TableColInfo = '^+~806':@vm:'^+~547':@vm:'^+~1526':@vm:'^+~547':@vm:'^+~907':@vm:'^+~806':@vm:'^+~720':@vm:'^+~720'
TableColInfo:= @vm:'^+~907':@vm:'^+~907':@vm:'^+~1080':@vm:'^+~447':@vm:'^+~907'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_ALL )
*RowsPrinted += 1 
* 
IF NEW.MARK.LEVEL THEN
S.WO=''
S.CUSTULNO=''
S.ABBREVULORULCOULNAME=''
S.PRODULSPECULID=''
S.THICKULTARGETULLONE=''
S.RESULTARGETULLONE=''
S.WAFERULINCHES=''
S.QTY=''
S.CUSTULSHIPULDATE=''
S.RECEIVEDULDATE=''
S.REACTORS=''
S.SCHEDULED=''
S.CLOSEULDATE=''
PREVIOUS.MARK.LEVEL=NEW.MARK.LEVEL
GOTO DETAIL
END
* 
GOTO READRECORD
* 
END

