The &&KILL_RPC flag is a ReportCaster amper variable that you can use in a pre-processing procedure when you want to stop ReportCaster processing and not execute the scheduled procedure, based on a condition. The condition may be the existence of a data extract, or a restriction on the days that schedules are allowed to run. The code to evaluate the condition can be a combination of Dialogue Manager commands and FOCUS commands supported by the WebFOCUS Reporting Server. The &&KILL_RPC amper variable must be set using Dialogue Manager.
The following sample code has been configured to run as a pre-processing procedure. It stops a request if the current date is in a list of holiday days.
-* -* TEST CURRENT DATE AGAINST A CALENDAR OF BUSINESS EXCEPTION DAYS -* The assumption here is that the dates in the data file are in -* ascending order FILEDEF HDAYRCLB DISK baseapp/hdayrclb.dat -RUN -* -SET &TDAYX = &YYMD; -SET &&KILL_RPC = 'N'; -* -*set PREV_DATE to some value that will cause the first IF to continue -* the loop -SET &PREV_DATE = 00000101; -REPEAT DATELOOP WHILE &&KILL_RPC NE 'Y'; -READ HDAYRCLB &FILEDATE.I8 -SET &&KILL_RPC = IF &TDAYX EQ &FILEDATE THEN 'Y' ELSE 'N'; -IF &PREV_DATE GE &FILEDATE THEN GOTO ENDME; -SET &PREV_DATE = &FILEDATE; -DATELOOP -ENDME
The following image shows the information that appears in the log report, including Executing pre-execution RPC 1 and User termination via KILL_RPC flag messages.
When &&KILL_RPC is set to Y to stop the execution of a scheduled job, the default behavior is to set the NEXTRUNTIME interval to the next run time value of the schedule stored in the WebFOCUS Repository and to trigger the Notification On Error condition when the schedule is stopped. You can control this behavior using the following global variables in the pre-execution procedure:
The following sample code takes the previous example and adds the next run time and notification global variables for &&KILL_RPC so that the next run time of the schedule is not reset and the On Error notification is not sent if the schedule is stopped because the current date is in the list of holiday days.
-* -* TEST CURRENT DATE AGAINST A CALENDAR OF BUSINESS EXCEPTION DAYS -* The assumption here is that the dates in the data file are in -* ascending order FILEDEF HDAYRCLB DISK baseapp/hdayrclb.dat -RUN -* -SET &TDAYX = &YYMD; -SET &&KILL_RPC = 'N'; -SET &&KILL_RPC_NRT = 'N'; -SET &&KILL_RPC_ERR = 'N'; -* -*set PREV_DATE to some value that will cause the first IF to continue -* the loop -SET &PREV_DATE = 00000101; -REPEAT DATELOOP WHILE &&KILL_RPC NE 'Y'; -READ HDAYRCLB &FILEDATE.I8 -SET &&KILL_RPC = IF &TDAYX EQ &FILEDATE THEN 'Y' ELSE 'N'; -IF &PREV_DATE GE &FILEDATE THEN GOTO ENDME; -SET &PREV_DATE = &FILEDATE; -DATELOOP -ENDME