API To Retrieve Runtime Control Site Information

Adabas System Coordinator allows storing of site-specific data in runtime controls. The contents and format of the data are entirely under your control. A typical use for it might be to define your own runtime controls (for example dynamic Natural parameters). The data can be retrieved using the supplied APIs. Two APIs are provided; one for 3GL and Assembler programs and one for Natural programs.


3GL API

The 3GL API is contained in the supplied COR3GLI load module. There are also some supplied source members showing how to use the API:

  • APIINF01: example of using the API in environments other than CICS

  • APIINF02: example of using the API in CICS

  • COR3GLIA: a parameter data area for calling COR3GLI

Start of instruction setTo use the 3GL API:

  1. Allocate storage for the parameter data area (1792 bytes).

  2. Initialize the storage to binary zeroes.

  3. Set the interface version (field name INFVRS in COR3GLIA) and function (INFFNC).

  4. Under CICS, set the name of the Adabas link module to be used (INFCICN). The link module must be capable of accepting parameter lists via the COMMAREA. If not under CICS, INFCICN must contain binary zeroes or spaces.

  5. If using the reentrant ADALNKR, allocate a modified area and set its address (INFAMOD).

  6. Link this program together with COR3GLI and, if not under CICS, your Adabas interface module, for example ADAUSER.

  7. After calling COR3GLI, INFRC will contain 0000 and INFDATA will contain the site information for this session; or, INFRC will contain a non-zero return code and INFRT will contain an explanatory message.

Natural API

The Natural API is contained in library SYSCOR, subprogram CORNATI. There are also some supplied source members in SYSCOR, showing how to use the API:

  • APIINF-P: example of calling CORNATI

  • CORNATIA: parameter data area for calling CORNATI

Start of instruction setTo use the Natural API:

  1. Ensure that subprogram CORNATI is available, by copying it to your Natural library or adding SYSCOR to your library’s steplibs in Natural Security.

  2. Set CORNATI-VERSION and CORNATI-FUNCTION.

  3. Call CORNATI.

  4. After calling CORNATI, CORNATI-RC will contain 0000 and CORNATI-SITEINFO will contain the site information for this session; or, CORNATI-RC will contain a non-zero return code and CORNATI-RT will contain an explanatory message.

Return Codes

These are the non-zero return codes which may be set:

Return Code Description
0001 Invalid interface version (must be 01)
0002 Invalid function (must be GETINFO)
0003 System Coordinator not available
0004 System Coordinator internal error
0005 System Coordinator internal error
0006 Adabas interface not linked (3GL API only)
0008 No site information for this session