{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "DECLARE SUBROUTINE ErrMsg, RList, Create_Note, Set_Property, Send_Message\r\nDECLARE FUNCTION  Send_Message, Center_Window, End_Window, Utility, PM_Services, Database_Services\r\n\r\n$INSERT RLIST_EQUATES\r\n$INSERT REACT_SERVS_EQU\r\n$INSERT REACTOR_PM_EQU\t\r\n$INSERT REACTOR_EQUATES\r\n$Insert PM_EQUATES\r\n\r\nVoid = Utility( 'CURSOR', 'H' )\r\nSet_Property(@WINDOW:'.LIST_1','VISIBLE',0)\r\n\r\nOPEN 'REACTOR_PM' TO RPMTable ELSE\r\n\tErrMsg('Unable to open REACTOR_PM table...')\r\n\tRETURN 0\r\nEND\r\n\r\nEndDt = Date() + 365\r\n\r\nStatement = 'SELECT REACTOR_PM WITH REACTOR NE \"\" AND WITH COMPLETE_DATE = \"\" AND WITH DUE_DT < ':QUOTE(OConv(EndDt, 'D4/')):' BY REACTOR BY-DSND NEXT_DONE'\r\nRList( Statement, target_activelist$, '', '', '' )\r\n\r\nReactNos = ''\r\nNextDueDts = ''\r\nServiceIDs = ''\r\n\r\nDone = 0\r\nLOOP\r\n\tREADNEXT RPMKey ELSE Done = 1\r\nUNTIL Done\r\n\tREAD RPMRec FROM RPMTable,RPMKey THEN\r\n\t\tReactNo\t\t= RPMRec<REACTOR_PM_REACTOR$>\r\n\t\tServiceID\t= RPMRec<REACTOR_PM_REACT_SERV_ID$>\r\n\t\tNextDueDt\t= RPMRec<REACTOR_PM_NEXT_DONE$>\r\n\t\t\r\n\t\tLOCATE ReactNo IN ReactNos BY 'AR' USING @FM SETTING RPos ELSE\r\n\t\t\tReactNos = INSERT(ReactNos,RPos,0,0,ReactNo)\r\n\t\tEND\r\n\t\t\r\n\t\tLOCATE NextDueDt IN NextDueDts<RPos> BY 'AR' USING @VM SETTING DPos ELSE\r\n\t\t\tNextDueDts = INSERT(NextDueDts,RPos,DPos,0,NextDueDt)\r\n\t\t\tServiceIDs = INSERT(ServiceIDs,RPos,DPos,0,ServiceID)\r\n\t\tEND\r\n\tEND\t;* End of RPMRec read\r\nREPEAT\r\n\r\nDisplay = ''\r\n\r\nReactCnt = COUNT(ReactNos,@FM) + (ReactNos NE '')\r\n\r\nPrevReactNo = ''\r\nFOR R = 1 TO ReactCnt\r\n\tReactNo = ReactNos<R>\r\n\t\r\n\tIF ReactNo NE PrevReactNo THEN\r\n\t\tReactRec\t= XLATE('REACTOR',ReactNo,'','X')\r\n\t\tReactType\t= OCONV(ReactRec<REACTOR_REACT_TYPE$>,'[REACT_TYPE_CONV,OPSREF]')\r\n\r\n\t\tReactDesc\t= ReactRec<REACTOR_REACT_DESC$>\r\n\t\tPrevReactNo = ReactNo\r\n\t\tIF Display NE '' THEN\r\n\t\t\tDisplay<-1> = '6-1:':STR('-',100)\r\n\t\tEND\r\n\t\tDisplay<-1> = '1-1: React No ':ReactNo:' ':ReactType:' ':ReactDesc\r\n\tEND\r\n\t\r\n\tndCnt = COUNT(NextDueDts<R>,@VM) + (NextDueDts<R> NE '')\r\n\t\r\n\tFOR I = 1 TO ndCnt\r\n\t\tNextDueDt\t= OCONV(NextDueDts<R,I>,'D4/')\r\n\t\tServiceID \t= ServiceIDs<R,I>\r\n\t\tService\t\t= XLATE('REACT_SERVS',ServiceID,REACT_SERVS_DESCRIPTION$,'X' )\r\n\t\t\r\n\t\tDisplay<-1> = '2-2: Due On: ':NextDueDt:' ':ServiceID:' ':Service\r\n\tNEXT I\r\n     //Get scrubber PM\r\n     ScrubberId = 'SCRUBBER':ReactNo\r\n     ScrubberPMs = PM_Services('GetActivePMsByToolId', ScrubberId)\r\n     For i = 1 To Dcount(ScrubberPMs, @VM)\r\n          ThisScrubberPMKey = ScrubberPMs<1, i>\r\n          ThisScrubberPMDueDate = Database_Services('ReadDataColumn', 'PM', ThisScrubberPMKey,PM_SCHED_DT$ , 1, 0, 0) \r\n          If ThisScrubberPMDueDate Le EndDt Then\r\n               Display<-1> = '2-2: Due On: ':Oconv(ThisScrubberPMDueDate, 'D/') : ' Scrubber PM.'\r\n          end\r\n     Next i\r\nNEXT R\r\n\r\nvoid = Center_Window(@WINDOW)\r\n\r\nSet_Property(@WINDOW:'.TITLE_LABEL','DEFPROP',\"Reactor PM's Due Before \":OCONV(EndDt,'D4,HL'))\r\n\r\nSet_Property(@WINDOW,'VISIBLE',1)\r\n\r\nSet_Property(@WINDOW:'.LIST_1','LIST',Display)\r\n\r\nSend_Message(@WINDOW:'.LIST_1', 'EXPAND', 0, 0 )\r\n\r\nSet_Property(@WINDOW:'.LIST_1','VISIBLE',1)\r\n\r\nvoid = Utility( 'CURSOR', 'A' )\r\n\r\nRETURN 1\r\n\r\n"
        }
    }
}