NetBase for MPE Reference Guide

Chapter 5
5-48
Parameter Description
old data
Original data before update.Only applicable for "update" and "delete" type
records. Note that this will be the ENTIRE dataset entry or file record.
new data
New data after update.Only applicable for "update" and "put" type records.
Same format as the "old data".
Post User Exit Notes
The first thing to keep in mind when writing post user exits is that one procedure must handle all
the files which require the use of this facility. In other words, the procedure must be able to go to
the appropriate section of the code based on the file name alone. A general outline of the logic of a
post user exit might be:
1. Determine if this is a known file. If not, return and set the action to 3. This will prevent
additional calls to the user exit for this file.
2. Assuming this is a known file, see if the file has been opened. Normally, the file number can be
stored in the userarea field. If it is open, skip to step 4.
Note. In many cases, a different data base or file from the original is opened.
3. If the file is not open, try to open it. If it cannot be opened, set the action value to -1 or -3.
These values cause the posting process to either discard or queue the updates, depending on
what is desired.
4. Process the update. Since the record structure is known, the procedure can now update the
information as needed. If anything goes wrong, the action value may be set to -2. This will
cause a "sync lost" to be generated.
5. Return from the procedure.