This document explains how clients built with the COBOL Wrapper set the Natural library used to execute the RPC request programmatically when communicating to a non-secure Natural RPC Server (not running with Natural Security). If the Natural RPC Server is running with Natural Security, see Using RPC Authentication (Natural Security, Impersonation, Integration Server).
You will need the following components:
the Delivered Modules, which are provided to create and get a security token
the RPC communication area copybook ERXCOMM
The code you write depends on the interface type:
This interface type applies to the scenarios CICS | Batch | IMS | Micro Focus.
To set the Natural library when communicating to a non-secure Natural RPC server
Declare and initialize the RPC communication area with one of the approaches described under Step 1: Declare and Initialize the RPC Communication Area in section Writing Standard Call Interface Clients.
Here you can use copybook ERXCOMM
only, or
both copybooks ERXCOMM
and ERXVSTR
.
Set the library in RPC Communication Area and call generic RPC service module to create a security token
with the function Create Security Token CT
provided by the generic RPC services module,
using the Call interface.
The code snippet below illustrates the variant where only copybook ERXCOMM
is used.
If you are using both copybooks ERXCOMM
and ERXVSTR
, see Note 1.
. . . MOVE "CT" TO COMM-FUNCTION. * Set library in RPC Communication Area MOVE "NAT-LIB" TO COMM-LIBRARY. * Call generic RPC service module to create security token (Note 1) CALL "COBSRVI" USING ERX-COMMUNICATION-AREA * Perform error-handling NOT ON EXCEPTION IF (COMM-RETURN-CODE = 0) THEN * Perform success-handling ELSE * Perform error-handling (See Note 2) END-IF END-CALL.
After successful return from the generic RPC services module, the required fields in the RPC communication area are properly set, so the non-secure Natural RPC server executes the RPC request in the library set.
Notes:
ERXCOMM
and ERXVSTR
are used, you need to pass both parameters:
CALL "COBSRVI" USING ERX-COMMUNICATION-AREA ERX-COMMUNICATION-VSTR.
COMM-RETURN-CODE
in the RPC communication area contains the error provided by the COBOL Wrapper.
For the error messages returned, see Error Messages and Codes.
This interface type applies to the scenario Using the COBOL Wrapper for CICS with DFHCOMMAREA
Calling Convention (z/OS and z/VSE).
To set the Natural library when communicating to a non-secure Natural RPC server
Declare the RPC communication area as described under Step 1: Declare IDL Structures and RPC Communication Area in section Writing EXEC CICS LINK
Clients.
Initialize the RPC communication area as described under Step 2: Initialize the RPC Communication Area under Writing EXEC CICS LINK
Clients.
Set the library in RPC Communication Area and call generic RPC service module to create a security token with the function
Create Security Token CT
provided by the generic RPC services module, using EXEC CICS LINK
.
MOVE "CT" TO COMM-FUNCTION. * Set library in RPC Communication Area MOVE "NAT-LIB" TO COMM-LIBRARY. EXEC CICS LINK PROGRAM ("COBSRVI") RESP (CICS-RESP1) RESP2 (CICS-RESP2) COMMAREA (ERX-COMMUNICATION-AREA) LENGTH (LENGTH OF ERX-COMMUNICATION-AREA) END-EXEC. IF WORKRESP = DFHRESP(NORMAL) IF (COMM-RETURN-CODE = 0) THEN * Perform success-handling ELSE * Perform error-handling (See Note 1) END-IF ELSE * Perform error-handling END-IF.
After successful return from the generic RPC services module, the required fields in the RPC communication area are properly set, so the non-secure Natural RPC server executes the RPC request in the library set.
Notes:
COMM-RETURN-CODE
in the RPC communication area contains the error provided by the COBOL Wrapper.
For the error messages returned, see Error Messages and Codes.