OpenTP1 Version 7 Programming Reference COBOL Language

[Contents][Index][Back][Next]

CBLDCRAP('CONNECT ') - 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 'CONNECT '.
    02  data-name-B   PIC X(5).
    02  FILLER       PIC X(3).
    02  data-name-C   PIC S9(9) COMP VALUE ZERO.
    02  data-name-D   PIC S9(9) COMP.
01  unique-name-2.
    02  data-name-E   PIC X(64).
    02  data-name-F   PIC S9(9) COMP.

Description

CBLDCRAP('CONNECT ') establishes a connection between a RAP-processing listener and a RAP-processing client.

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'CONNECT[Figure]' for the request code indicating the request for establishment of a connection with a RAP-processing listener.

data-name-C

Specify 0.

data-name-E

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 64 characters. To specify a host name longer than 65 characters, use CBLDCRAP('CONNECTX').

data-name-F

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

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 code Explanation
00000 Normal termination. A connection was established with the RAP-processing listener.
05501 Either the value specified in a data area is invalid, or a data area has not been set. Check the following items:
  • Values of data-name-A and data-name-C ('CONNECT ' and 0, respectively)
  • Number of characters set in data-name-E (1 to 64)
  • Allowable range of the data-name-F value (1 to 65535)
  • Data area data-name-D
05502 The 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('CONNECT ') was called.
  • The -w option was not specified in the dcsvgdef definition command in the user service network definition.
05503 The memory became insufficient.
05517 The specified value exceeds the maximum number of CBLDCRAP('CONNECT ') functions which can be called from a single process.
05505 A network error occurred during communication with the RAP-processing listener.
05506 A timeout occurred during communication with the RAP-processing listener.
05507 The number of sockets became insufficient.
05508 The host name cannot be resolved.
05521 The RAP-processing listener is being terminated.
05522 An 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.
05523 An unexpected error occurred during system call.
05531 An attempt was made to establish a connection with a RAP-processing listener which is on an unconnected network.
05520 The memory became insufficient on the RAP-processing listener or RAP-processing server.
05532 A 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.
05533 A system error occurred in the RAP-processing listener.
05528 The RAP-processing listener is being started or terminated.
05529 A connection has already been established with the RAP-processing listener.
05534 The 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('CONNECT ') 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 while the value Y was specified in the rpc_rap_auto_connect operand in the user service definition. Another possibility is that the user service network has not been defined.