SPMAXLEN and SPRECLEN

RSP3C uses the SPAREA to pass information about the type of data pipe to MainframeConnect.

MOVE 'INPUT'             TO SPMODE.
 MOVE 'STD'               TO SPFORMAT.
 MOVE 55                  TO SPMAXLEN.
 CALL 'OPENPIPE' USING SPAREA.

In this example, the type and format of the pipe are specified using the SPAREA SPMODE and SPFORMAT fields. Because the exact length of the record is not known, a maximum record length is specified with SPMAXLEN.

In the following example, you can see that because you already set the maximum input record size with SPMAXLEN and the OPENPIPE command, you do not need to reset SPRECLEN for each GETPIPE command. MainframeConnect determines the size of the input record and sets SPRECLEN accordingly.

SET SPINTO TO ADDRESS OF WS-INPUT-REC
 CALL 'GETPIPE' USING SPAREA

In the following example, RSP3C uses SPRECLEN with a PUTPIPE command to pass the length of an output record to MainframeConnect.

SET SPFROM TO ADDRESS OF WS-INPUT-REC
 MOVE 55 TO SPRECLEN
 CALL 'PUTPIPE' USING SPAREA

The following table describes these SPAREA fields in RSP3C and explains how they are used.

Table C-1: SPAREA fields describing records

SPAREA field

Use

SPMODE

Specifies the mode of the data pipe. Valid values are 'INPUT' or 'OUTPUT'.

SPFORMAT

Specifies the format of the data to be transmitted through the pipe. Valid values are:

  • 'DB2' (only for output pipes)

  • 'STD'

  • 'BIN'

SPMAXLEN

Specifies the maximum record length of records transmitted through a STD or BIN format pipe.

NoteFor DB2 or STD format pipes, you provide maximum record length information in the SQLDA.

SPRECLEN

Specifies the length of a particular record transmitted through a STD or BIN format pipe. For output pipes, the RSP sets this value; for input pipes, MainframeConnect sets this value.

NoteYou must specify either SPMAXLEN or SPRECLEN, which defines the actual length of a particular data record.