CBLDCRAP('CONNECTX') - Establish connection with a RAP-processing listener

Format

PROCEDURE DIVISION specification

CALL 'CBLDCRAP' USING unique-name-1 unique-name-2

DATA DIVISION specification

01 unique-name-1.
  02 data-name-A  PIC X(8) VALUE 'CONNECTX'.
  02 data-name-B  PIC X(5).
  02 FILLER    PIC X(3).
  02 data-name-C  PIC S9(9) COMP VALUE 1.
  02 data-name-D  PIC S9(9) COMP.
01 unique-name-2.
  02 data-name-E  PIC S9(9) COMP.
  02 data-name-F  PIC X(n).
  02 FILLER    PIC X(1) VALUE LOW-VALUE.

Description

CBLDCRAP('CONNECTX') establishes a connection between a RAP-processing listener and a RAP-processing client. The host name area is a variable-length area. It can accommodate a host name longer than 65 characters.

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'CONNECTX' for the request code indicating the request for establishment of a connection with a RAP-processing listener.

data-name-C

Specify 1.

data-name-E

Specify the port number of the well-known port being used by the RAP-processing listener.

data-name-F

Specify the host name of the OpenTP1 node on which the RAP-processing listener was activated. The specified host name must consist of 1 to 255 characters.

Data areas whose values are returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

data-name-D

This area receives the service ID.

A service ID is returned when a connection with the RAP-processing listener was established successfully. Use the same service ID in CBLDCRAP('DISCNCT ') when releasing the connection.

Status codes

Status codeExplanation
00000Normal termination. A connection was established with the RAP-processing listener.
05501The value specified for a data area is invalid or a required data area is not specified. Review the following values:
  • Values of data-name-A and data-name-C ('CONNECTX' and 1, respectively)
  • Allowable range of the data-name-E value (1 to 65535)
  • Number of characters in data-name-F (1 to 255)
  • Area of data-name-D
05502The protocol is invalid. Possible causes are as follows:
  • CBLDCRPC('OPEN ') was not called.
  • Although the rpc_rap_auto_connect operand in the user service definition had been set to Y, the function CBLDCRAP('CONNECTX') was called.
  • The -w option was not specified in the dcsvgdef definition command in the user service network definition.
05503The memory became insufficient.
05505A network error occurred during communication with the RAP-processing listener.
05506A timeout occurred during communication with the RAP-processing listener.
05507The number of sockets became insufficient.
05508The host name cannot be resolved. Verify data-name-F or the DNS server.
05517The maximum number of CBLDCRAP('CONNECTX') calls from a single process was exceeded.
05520The memory became insufficient on the RAP-processing listener or RAP-processing server.
05521The RAP-processing listener is being terminated. Alternatively, verify data-name-E.
05522An error which prevents continuation of processing occurred. Possible causes of the error are as follows:
  • An unexpected message was received.
  • A message was received unexpectedly from a remote system.
05523An unexpected error occurred during system call.
05528The RAP-processing listener is being started or terminated.
05529A connection has already been established with the RAP-processing listener.
05531An attempt was made to establish a connection with a RAP-processing listener which is on an unconnected network.
05532A connection could not be established within the message exchange monitoring time specified in the rap_watch_time operand of the RAP-processing listener service definition.
05533A system error occurred in the RAP-processing listener.
05534The specified value exceeds the maximum number of requests which can be accepted for connection with a RAP-processing client that is managed by a RAP-processing listener.

Note

If CBLDCRAP('CONNECTX') returns with an error and the status code is a value other than 05529, connection was not established with the RAP-processing listener.

The error code acquired by the UAP trace is as follows:

0: No error
1: No value was specified for unique-name-1.
2: The request code (data-name-A) is invalid.
3: No value was specified for unique-name-2.
6: CBLDCRAP('CONNECT') was called even though the value specified for the rpc_rap_auto_connect operand in the user service definition is Y. Alternatively, the user service network has not been defined.