Register exit programs

Identify IBM i exit programs to call.

Work with the registration facility

For the servers to know which exit program, if any, to call, you must register your exit program. You can register the exit program using the IBM i registration facility.

In addition to registering an exit program, it is necessary to restart the prestart jobs for a particular server. Without this step, the exit program is not called until, through attrition, new server jobs start. For the file server exit program to be invoked, the QSERVER subsystem must be restarted.

To register an exit program with the registration facility, use the Work with Registration Information (WRKREGINF) command.

+--------------------------------------------------------------------------------+
|                     Work with Registration Info (WRKREGINF)                    |
|                                                                                |
| Type choices, press Enter.                                                     |
|                                                                                |
| Exit point . . . . . . . . . . .   *REGISTERED                                 |
| Exit point format  . . . . . . .   *ALL          Name, generic*, *ALL          |
| Output . . . . . . . . . . . . .   *             *, *PRINT                     |
|                                                                                |
+--------------------------------------------------------------------------------+

Press Enter to view the registered exit points.

+--------------------------------------------------------------------------------+
|                       Work with Registration Information                       |
|                                                                                |
| Type options, press Enter.                                                     |
|   5=Display exit point   8=Work with exit programs                             |
|                                                                                |
|                            Exit                                                |
|      Exit                  Point                                               |
| Opt  Point                 Format    Registered  Text                          |
|  _   QIBM_QCA_CHG_COMMAND  CHGC0100     *YES     Change command exit programs  |
|  _   QIBM_QCA_RTV_COMMAND  RTVC0100     *YES     Retrieve command exit progra  |
|  _   QIBM_QHQ_DTAQ         DTAQ0100     *YES     Original data queue server    |
|  _   QIBM_QIMG_TRANSFORMS  XFRM0100     *YES                                   |
|  _   QIBM_QJO_DLT_JRNRCV   DRCV0100     *YES     Delete Journal Receiver       |
|  _   QIBM_QLZP_LICENSE     LICM0100     *YES     Original License Mgmt Server  |
|  _   QIBM_QMF_MESSAGE      MESS0100     *YES     Original Message Server       |
|  _   QIBM_QMH_REPLY_INQ    RPYI0100     *YES     Handle reply to inquiry mess  |
|  8   QIBM_QNPS_ENTRY       ENTR0100     *YES     Network Print Server - entry  |
|  _   QIBM_QNPS_SPLF        SPLF0100     *YES     Network Print Server - spool  |
|  _   QIBM_QOE_OV_USR_ADM   UADM0100     *YES     OfficeVision/400 Administrat  |
|                                                                                |
| Command                                                                        |
| ===>                                                                           |
|                                                                                |
+--------------------------------------------------------------------------------+

Choose option 8 to work with the exit programs for the exit point defined for the server you would like to work with.

+--------------------------------------------------------------------------------+
|                            Work with Exit Programs                             |
|                                                                                |
| Exit point:   QIBM_QNPS_ENTRY            Format:   ENTR0100                    |
|                                                                                |
| Type options, press Enter.                                                     |
|   1=Add   4=Remove   5=Display   10=Replace                                    |
|                                                                                |
|               Exit                                                             |
|             Program     Exit                                                   |
| Opt          Number     Program        Library                                 |
| 1_                      __________     __________                              |
|                                                                                |
|   (No exit programs found)                                                     |
|                                                                                |
+--------------------------------------------------------------------------------+

Use option 1 to add an exit program to an exit point.

Notes:
  • If an exit program is already defined, you must remove it before you can change the name of the program.
  • Even though the registration facility can support multiple user exits for a specific exit point and format name, the servers always retrieve exit program 1.
  • You must end and restart the prestart jobs for the change to go into effect.
+--------------------------------------------------------------------------------+
|                          Add exit program (ADDEXITPGM)                         |
|                                                                                |
| Type choices, press Enter.                                                     |
|                                                                                |
|Exit point . . . . . . . . . . . > QIBM_QNPS_ENTRY                              |
|Exit point format  . . . . . . . > ENTR0100      Name                           |
|Program number . . . . . . . . . > 1             1-2147483647, *LOW, *HIGH      |
| Program  . . . . . . . . . . . .  MYPGM         Name                           |
|   Library  . . . . . . . . . . .    MYLIB       Name, *CURLIB                  |
|THREADSAFE . . . . . . . . . . .   *UNKNOWN      *UNKNOWN, *NO, *YES            |
|Multithreaded job action . . . .   *SYSVAL       *SYSVAL, *RUN, *MSG,           |
|Text 'description' . . . . . . .   *BLANK                                       |
|                                                                                |
+--------------------------------------------------------------------------------+

Enter your program name and library for the program at this exit point.

The same program is usable for multiple exit points. The program can use the data that is sent as input to determine how to handle different types of requests.

The following table provides the exit point and format names for each of the specific IBM i servers.
Table 1. Server exit point to format mapping
Server Format name(s) Application name
QIBM_QPWFS_FILE_SERV (File Server) PWFS0100 *FILESRV
QIBM_QZDA_INIT (Database server initiation) ZDAI0100 *SQL
QIBM_QZDA_NDB1 (Database server-native database requests) ZDAQ0100 ZDAQ0200 *NDB
QIBM_QZDA_ROI1 (Database server retrieve object information requests) ZDAR0100 ZDAR0200 *RTVOBJINF
QIBM_QZDA_SQL1 (Database server SQL requests) ZDAQ0100 *SQLSRV
QIBM_QZDA_SQL2 (Database server SQL requests) ZDAQ0200 *SQLSRV
QIBM_QZHQ_DATA_QUEUE (Data queue server) ZHQ00100 *DATAQSRV
QIBM_QNPS_ENTRY (Network print server) ENTR0100 QNPSERVR
QIBM_QNPS_SPLF (Network print server) SPLF0100 QNPSERVR
QIBM_QZSC_LM (Central server license management requests) ZSCL0100 *CNTRLSRV
QIBM_QZSC_NLS (Central server NLS requests) ZSCN0100 *CNTRLSRV
QIBM_QZSC_SM (Central server client system management) ZSCS0100 *CNTRLSRV
QIBM_QZRC_RMT (Remote command and distributed program call server) CZRC0100 *RMTSRV
QIBM_QZSO_SIGNONSRV (Signon server) ZSOY0100 *SIGNON