You can write a user exit
module in any language that meets the following criteria:
-
The language runs in 31-bit addressing
mode.
-
The language supports standard
OS linkage.
Examples of such languages
are IBM assembly language and C. For an example of an exit that
is written in assembly language, see
Sample Program.
Note: In all the figures in this
appendix, the field names that are shown in parentheses (for example,
EXITIDB in
UEBCB Structure, Part 1 of 2) are the ones that were used in the
sample program.
In your user exit module,
you should include code for all seven of the functions that are described
in
Function Descriptions. At the beginning of your user exit
module, examine the function code that was passed to you in the Function
Request Control Block (described in the next section), and branch
to the routine or function that is being requested.
When you write the user
exit module, you must follow IBM conventions for assembler linkage.
You must also set R15 to a return code value that indicates whether
the user exit was successful. Any nonzero return code causes execution
to stop. If you want to write an error message to the SAS log, use
the SAS LOG service routine. For more information, see “LOG”
in
SAS Service Routines.
If the user exit terminates
with a nonzero return code value, then you must put the address of
a user-defined message string that ends in a null ('00'x) character
in the Pointer to User Error Message (ERRMSG) field of the User Exit
BAG Control Block. For more information, see
User Exit BAG Control Block. This message is printed in the SAS
log.
Return code values that
apply to particular function requests are listed with the descriptions
of those functions in later sections of this appendix.
Be sure to take advantage
of the SAS service routines when you write your user exit functions.
For more information, see
SAS Service Routines.