Writes data records to an output pipe. Open ServerConnect then reads the records and sends them to the client application.
Syntax varies with the programming language.
This example writes a 130-byte data record built in a storage area called AREA1 to a STD format input pipe:
MOVE 130 TO SPRECLEN. SET ADDRESS OF AREA1 TO SPFROM. CALL 'PUTPIPE' USING SPAREA.
The PUTPIPE command uses values from these SPAREA fields:
SPFROM (see “SPFROM”) specifies the address of the data record.
SPRECLEN (see “SPRECLEN”) specifies the length of the data record.
SPSQLDA (see “SPSQLDA”) provides the SQLDA address.
Only STD and BIN format pipes use the SPFROM field. For a DB2 format pipe, the SQLDA describes the location and length of the data columns.
If you have a single output pipe open, you can set the SPFROM value once for all records. However, when you have both an input pipe and an output pipe open, both pipes use this field and each must set the field value before writing or reading the record.
For STD and BIN pipes, the SPRECLEN value must not exceed the value that was specified for SPMAXLEN (see “SPMAXLEN”) when the pipe was opened.
If you write fixed-length records of the same size as SPMAXLEN, the SPRECLEN value is not required.