SPAREA example

In the following example, the LWKCOMMAREA is the RSP API communication area. SPAREAC (the sample COBOL II copy book provided on the Open ServerConnect base tape) is included in the linkage section with a COPY statement.

01  LWKCOMMAREA.
 	COPY SPAREAC.

Further on in the program, the SPAREA fields pass information about the type of data pipe the RSP uses and the pointers to the SQLDA.

MOVE 'OUTPUT'             TO SPMODE.
 MOVE 'DB2'                TO SPFORMAT.
 SET SPSQLDA               TO ADDRESS OF SQLDA.
CALL 'OPENPIPE'           USING SPAREA.

The following three SPAREA fields are used by the RSP to communicate to the Open ServerConnect RSP API:

See “SPAREA field descriptions” for more information on all the SPAREA fields.