Invoking the APIs

During execution, the API routines use PAC subroutines residing in the SYSPAC and SYSTEM libraries.

  1. If the application that calls the PAC API subroutines does not reside in the SYSPAC library, define the SYSPAC library as steplib to the Natural session.

  2. Use the following syntax to invoke a PAC API:

    CALLNAT  'APINxxxx'  UGNLPARM  UxxLyyyy
    

    where

    • the first parameter (supplied as local data area UGNLPARM) has a fixed format; and

    • the second parameter (supplied as UxxLyyyy) has a variable format, depending on the particular API call. The variable format for each API is detailed in the following API descriptions.

This document covers the following topic:


Local Data Area UGNLPARM

The first parameter of all PAC APIs is the following structure API-PARM. Its definition is provided in the local data area UGNLPARM:

Field Name Format Description
API-PARM - -
API-FUNC (R) A2 (optional) Identifies the code of the subfunction for the request.
API-MAIN-FUNC A1 (I) The code of the function to execute on the entity.
API-SUB-FUNC A1 (I) (optional) Identifies the code of the subfunction for the request.
API-MSG-NO P5 (O) PAC error message number.
API-MSG A78 (O) Detailed message of any error occurred during processing.
API-USER-AREA A50 (I/O) Area used by additional routines or exits invoked during the processing of the API request.