Using the SPAREA

The SPAREA is the storage area that passes information between the CSA and Open ClientConnect. The CSA supplies the SPAREA and notifies Open ClientConnect that it is available using the CSSETUP command. The statement copying the SPAREA definition into the CSA must be in the LINKAGE SECTION so that the SPAREA is available to Open ClientConnect:

01  STORE-PROC-AREA.
 	COPY SPAREAC.

NoteThe CSA allocates the storage for the SPAREA in the LINKAGE SECTION. (The programmer is responsible.)

The following example illustrates how to use the SPAREA to pass information to Open ClientConnect about the data pipe the CSA is using:

MOVE 'INPUT '         TO SPMODE.
 MOVE 'DB2'            TO SPFORMAT.
 CALL 'OPENPIPE' USING SPAREA.

Two SPAREA fields are used with the OPENPIPE command. The SPMODE field specifies the mode (always input for CSAs) of the data pipe, and the SPFORMAT field specifies the format (always DB2 for CSAs) of the data to be transmitted through the pipe.

See Appendix E, “The SPAREA” for detail on all the SPAREA fields and their uses.