VERIFIED SOLUTION i

How to use MailStream Plus EXITIN and EXITOP parameters to call an external program

MailStream Plus- all versions, all platforms
More information on usage of the EXITIN and EXITOP parameters are in the Reference Guide for the version of MailStream Plus (MSP) that is being used.

There are no samples or examples of EXIT routines available, but the following provides some additional general information about using them.

The external routine can be written in several possible languages (C#, Cobol, Java, Visual Basic, assembler, etc.) depending on the computer Operating System/platform beng used, as long as the routine can use 'standard linkage' as mentioned in the Reference Guide for the two parameters.

EXITIN and EXITOP each send 4 parts of data, as listed in the Reference Guide.  One part is the actual record being processed at the time, and so the external routine needs to be able to accept the largest record that will be passed to it. 

If using EXITIN, the external routine will get called for *each* record in *both* MSNAIN and MSSTIN files.

If using EXITOP, the external routine will get called for *each* record in *each* of the 10 files listed in the Reference Guide in the 'EXITOP File Activators' chart in the parameter section.

Because of the two items above, one of the things the external routine should do is check for the activator code being passed to it.  Each file that is processed has a different Activator code. If the code is not for one of the files that the routine is intended to deal with, have the routine exit back to MSP.
For example, say EXITOP is being used and the external routine is meant to *only* deal actively with records of the MSNAON file ('Posting name/address output'.)  When that file is being processed, the passed Activator code will be 'ON'.  So the external routine should check the passed activator code and if it is anything other than ON, have the routine just exit back to MSP.
UPDATED:  May 5, 2017