NetBase for MPE Reference Guide

NetBase Shadowing
5-43
Post User Exits
The posting process posts updates to a file or a database that is being shadowed. Sometimes,
however, additional processing is required. For instance, updates to a particular set of a database
may need to be made to a second database. NetBase's posting process has a method of handling
these special cases. When additional processing is required, the posting process calls a user-
supplied subroutine. The procedure called by the posting process is called POSTUSEREXIT.
Currently, the user exit procedure must be in either the XL.NB.NETBASE, XL.PUB.NETBASE or
XL.PUB.SYS library.
The user exit procedure will be dynamically loaded by the NBPOST program when needed. In order
to update the user exit procedure, posting must be stopped to unload the procedure.
Note. Since only one user exit procedure name is currently supported, the procedure
must have the logic necessary to process all files simultaneously. This typically requires
simple switching logic to other procedures.
Any shadow file may be selected for the user exit facility. Once a file has been selected, all shadow
records will be passed to the user exit. The user exit then has the ability to process the data at will.
When the user exit procedure returns, an action code set by the user exit procedure will direct
NBPOST to further process the update record. These actions are described below.
To select a file for user exit processing, a SHADOW command such as the following must be entered
in the NBDIR program:
D> SHADOW ARCUST.DATA.PROD;PASS=CUSTPASS;USEREXIT
This will inform the NBPOST program that the file or database must be processed by the user exit
procedure.
POSTUSERINIT
This section describes the calling conventions for the POSTUSERINIT procedure. This procedure is
called the first time a transaction is received for a shadowed file. It allows initialization to take
place before the POSTUSEREXIT procedure is called.
Syntax
POSTUSERINIT (comarea,userarea,filename)