Coding rules for exit routines
You must follow certain rules and requirements when coding an exit routine for Db2.
It must be written in assembler.
- It must reside in an authorized program library, either the library containing Db2 modules (prefix.SDSNLOAD) or in a library concatenated ahead of prefix.SDSNLOAD in the procedure for the database services started task (the procedure named ssnmDBM1, where ssnm is the Db2 subsystem name). Authorization routines must be accessible to the ssnmMSTR procedure. For all routines, we recommend using the library prefix.SDSNEXIT, which is concatenated ahead of prefix.SDSNLOAD in both started-task procedures.
- The following routines must have the names shown. The name
of other routines should not start with
DSN
, to avoid conflict with the Db2 modules.Table 1. Required load module name Type of routine Required load module name Date DSNXVDTX Time DSNXVTMX Connection DSN3@ATH Sign-on DSN3@SGN - It must be written to be reentrant and must restore registers before return.
- It must be link-edited with the REENTRANT parameter.
- It must be written and link-edited to execute AMODE(31),RMODE(ANY).
- It must not invoke any Db2 services—for example, through SQL statements.
- It must not invoke any SVC services or ESTAE routines.
Even though Db2 has
functional recovery routines of its own, you can establish your own
functional recovery routine (FRR), specifying MODE=FULLXM and EUT=YES.