Unlinking an Application Program from the API Library

When an application program is finished communicating with the API library, it breaks its link with the API library. The application program does this by calling the UNLINK_APPL_PROGRAM procedure. When the link is terminated, a message is sent to Operations Sentinel specifying the job number of the application program, the name of the application program, and the message UNLINKED FROM API.

This is the declared exported procedure:

PROCEDURE UNLINK_APPL_PROGRAM(LINKREQUEST);
EBCDIC ARRAY LINKREQUEST[0];
LIBRARY SPIAPISUPP;

Input

Initialized the array LINKREQUEST with the following input parameters:

LINKREQUEST 				Description
LINKREQUEST[0]			Application program identification number (length=6
										characters)

Procedure Call Example

In this example, the application program moves the program identification number stored in the APPL_ID array into the LINKREQUEST array. It then calls the UNLINK_APPL_PROGRAM procedure to unlink the application from the API library.

REPLACE LINKREQUEST[0] BY APPL_ID FOR 6;
UNLINK_APPL_PROGRAM(LINKREQUEST);

Results

If the Operations Sentinel server is available, the API library sends the UNLINKED FROM API message containing the application program identification number to the Operations Sentinel server.