Opens a data pipe either to send output to or receive input from the client application.
Syntax varies with the programming language.
Open a STD output pipe:
MOVE 'OUTPUT' TO SPMODE. MOVE 'STD' TO SPFORMAT. MOVE 450 TO SPMAXLEN. CALL 'OPENPIPE' USING SPAREA.
Open a BIN input pipe:
MOVE 'INPUT' TO SPMODE. MOVE 'BIN' TO SPFORMAT. MOVE 625 TO SPMAXLEN. CALL 'OPENPIPE' USING SPAREA.
The OPENPIPE command uses values from these SPAREA fields:
SPMODE (see “SPMODE”) specifies whether the data pipe is opened for input or output.
INPUT indicates the RSP reads data records sent from the client application.
OUTPUT indicates the RSP writes data records to be sent to the client application.
SPFORMAT (see “SPFORMAT”) specifies the data pipe format.
STD indicates standard format, in which each data record is transmitted to or from the client application as a single-text column record.
BIN indicates a single-binary column format, like STD, except that the data is binary. No ASCII-EBCDIC or EBCDIC-ASCII conversion occurs on binary data.
Use STD and BIN only
for input pipes.
DB2 indicates data is transmitted from the RSP as a multiple-column record, where the column definitions are contained in an associated SQLDA. The SQLDA is a collection of variables and pointers that provide column information about data being transmitted to the client application. See Appendix G, “The SQLDA” for more information.
Use DB2 only for output pipes.
SPMAXLEN (see “SPMAXLEN”) specifies the maximum size, in bytes, of the data records written to or read from the data pipe.
SPSQLDA (see “SPSQLDA”) specifies the address of a SQLDA that describes the content of the data records. Use only for output pipes.
STD and BIN format pipes must use SPMAXLEN to identify the maximum record length.
For DB2 format pipes, the RSP must supply the SPSQLDA address. DB2 format pipes must use SPSQLDA.
Both an input pipe and an output pipe can be open at the same time.
As part of opening a pipe, you must specify the format of the data the pipe handles. RSPs can handle DB2, BIN, and STD format data. See Chapter 2, “Designing an RSP” for more information on these formats.
When a data pipe of any format opens for output with the OPENPIPE command, it issues Open Server describe and bind commands. You cannot subsequently change the maximum column length of any columns or types in the SQLDA definition when you issue a PUTPIPE command.