Using Batch Console in Scripts Initiated by BCNOTIFY

You can use the Batch Console to make the service start a process command or notify a currently running process command to stop after a specified AFN. This mode of operation replaces dbauditwait working in conjunction with the deprecated NOTIFY program on the mainframe and uses the service-initiated DBClient runs instead of the command-line client. When invoking the Batch Console in a script launched by the service, you must pass the handle to Batch Console using the /P option.

bconsole /P %2 sample_script2.bcs mikera018684 MISDB 1234

The following Batch Console source file sample_script2.bcs uses command-line parameters similar to a Windows command file, except that the parameters are numbered starting with the one that follows the source filename. The program does a textual substitution by replacing %n with the exact text of the corresponding parameter. (This script is located in the scripts directory of the service's working directory.)

connect to %1 port 8001

if run active %2 then

stop run %2 after afn %3


process %2 with option "/F %3"

end if

In the above example, the text %1 is replaced by mikera018640, %2 is replaced by MISDB and %3 is replaced by “1234”.