INITAPI and INITAPIX calls

The INITAPI and INITAPIX calls connect an application to the TCP⁄IP interface. The sole difference between INITAPI and INITAPIX is explained in the description of the IDENT parameter. INITAPI is preferred over INITAPIX unless there is a specific need to connect applications to alternate TCP/IP stacks. CICS® sockets programs that are written in COBOL, PL/I, or assembler language should issue the INITAPI or INITAPIX macro before they issue other calls to the CICS sockets interface.

If a CICS task's first call to the CICS socket interface is not an INITAPI or INITAPIX, then the CICS socket interface generates a default INITAPI call.

The following requirements apply to this call:
Requirement Description
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
Amode: 31-bit or 24-bit
ASC mode: Primary address space control (ASC) mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space

Figure 1 shows an example of INITAPI call instructions. The same example can be used for the INITAPIX call by simply changing the SOC-FUNCTION value to 'INITAPIX'.

Figure 1. INITAPI call instruction example
    WORKING-STORAGE SECTION.
        01  SOC-FUNCTION    PIC X(16)  VALUE IS 'INITAPI'.
        01 MAXSOC-FWD       PIC 9(8) BINARY.
        01 MAXSOC-RDF REDEFINES MAXSOC-FWD. 
            02 FILLER       PIC X(2). 
            02 MAXSOC       PIC 9(4) BINARY.
        01  IDENT.
            02  TCPNAME     PIC X(8).
            02  ADSNAME     PIC X(8).
        01  SUBTASK         PIC X(8).
        01  MAXSNO          PIC 9(8) BINARY.
        01  ERRNO           PIC 9(8) BINARY.
        01  RETCODE         PIC S9(8) BINARY.
 
    PROCEDURE DIVISION.
         CALL 'EZASOKET' USING SOC-FUNCTION MAXSOC IDENT SUBTASK
         MAXSNO ERRNO RETCODE.

For equivalent PL/I and assembler language declarations, see Converting parameter descriptions.