OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P
(a) In a multi-thread environment
PROCEDURE DIVISION
CALL 'CBLDCCLS' USING identifier-1 identifier-2 identifier-3
DATA DIVISION
01 identifier-1.
02 data-name-A PIC X(8) VALUE 'ASMSEND'.
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 9(4) COMP.
02 FILLER PIC X(2).
02 data-name-E PIC S9(9) COMP.
02 FILLER PIC X(4).
02 data-name-F PIC X(n).
01 identifier-2.
02 data-name-G PIC S9(9) COMP.
02 data-name-H PIC X(n).
01 identifier-3.
02 data-name-I PIC 9(9) COMP.
(b) In a single-thread environment
PROCEDURE DIVISION
CALL 'CBLDCCLT' USING identifier-1 identifier-2
DATA DIVISION
01 identifier-1.
02 data-name-A PIC X(8) VALUE 'ASMSEND'.
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 9(4) COMP.
02 FILLER PIC X(2).
02 data-name-E PIC S9(9) COMP.
02 FILLER PIC X(4).
02 data-name-F PIC X(n).
01 identifier-2.
02 data-name-G PIC S9(9) COMP.
02 data-name-H PIC X(n).
(2) Purpose
Uses the message assembly facility to send messages. When this facility is used, the statement sends four-byte message information followed by the message body specified in data-name-H. If a connection to the remote system has not been established, the function establishes the connection according to the host name specified in data-name-F and the port number specified in data-name-D before sending messages.
If Y is specified for DCCLTDELIVERYCHECK of the client environment definition, the message delivery confirmation facility is used when a message is sent or received. In this case, the size of the message information sent before the message body is 11 bytes. After sending the 11-byte message information, TP1/Client returns control to the CUP.
Before executing CBLDCCLS('ASMSEND '), make sure that you execute CBLDCRPS('OPEN ') in which 4 or 16 is specified in data-name-C.
(3) Data area where the UAP sets values
- data-name-A
Set VALUE 'ASMSEND' as the request code for sending a message.
- data-name-C
Specify whether to release the connection after the message is sent.
0: After a message is sent, the connection is not released until CBLDCRPS('CLOSE ') is executed (exception: an error occurs).
1: After a message is sent, the connection is released. When the message delivery confirmation facility is being used, the connection is released after message information is received.
- data-name-D
Specify the port number of the node to be connected when there is no connection and a connection must be established.
If 0 is specified, the statement accesses the contents of DCSNDPORT in the client environment definition acquired when CBLDCRPS('OPEN ') was executed.
- data-name-E
This argument takes effect when the message delivery confirmation facility is used. Specify the maximum time (in seconds) that the statement waits for response-only data to arrive. The value must be an integer from -1 to 65,535.
- If -1 is specified:
- The statement waits indefinitely for response-only data.
- If 0 is specified:
- The statement does not wait for response-only data. If there is no message to be received, the statement returns a 02507 error.
- If any value from 1 to 65,535 is specified:
- The statement waits for a message, but returns a 02507 error if a message does not arrive within the specified number of seconds.
If divided response-only data arrives, the statement repeats the receive processing until 11-byte response-only data arrives. The timeout specified by this argument is applied every time the statement attempts reception. If you want to use the value of this argument as the maximum response wait time for the client, specify the 00000002 option for DCCLTOPTION of the client environment definition.
- data-name-F
Specify the host name of the node to be connected when no connection is established. You can specify a maximum of 63# characters for the host name. Make sure that the specified character string ends with a space character.
If the specified character string begins with a space character, the statement references the contents of DCSNDHOST in the client environment definition acquired when CBLDCRPS('OPEN ') was executed.
You can also specify an IP address in decimal dot notation for the host name.
- #:
- If you specify 00000008 for DCCLTOPTION in the client environment definition, you can specify a maximum of 255 characters for the host name.
- data-name-G
Set the length of the message to be sent.
- data-name-H
Set the area that contains a message to be sent. The area must be larger than the length specified in data-name-G.
- data-name-I
Set the client ID received by CBLDCCLS('CLTIN ') or CBLDCCLS('EXCLTIN ').
(4) Data area for which a value is returned
- data-name-B
5-digit status code
(5) Status codes
Status code |
Meaning |
00000 |
Normal termination |
02501 |
Invalid argument |
02502 |
Possible causes are as follows:
- CBLDCRPS('OPEN ') has not been executed.
- CBLDCRPS('OPEN ') was executed, but neither 4 nor 16 was specified in data-name-C.
|
02504 |
Insufficient memory |
02506 |
A network error occurred. The connection is released. |
02507 |
A connection establishment request timed out. Alternatively, reception of response-only data timed out when the message delivery confirmation facility was being used. The connection is released. |
02518 |
A system error occurred. If the error is a network error, the connection is released. |
02538 |
Insufficient resource |
02539 |
The host name is incorrect. Alternatively, a host name is not specified in either data-name-F or DCSNDHOST. |
02541 |
A connection establishment request to the remote system was rejected. |
02542 |
The connection was released by the remote system when the message delivery confirmation facility was being used. |
02544 |
The client ID specified in data-name-I differs from the one received by CBLDCCLS('CLTIN ') or CBLDCCLS('EXCLTIN '). |
02547 |
Port numbers that can be assigned automatically by the operating system are insufficient. |
02548 |
An invalid message was received when the message delivery confirmation facility was being used. The connection is released. |
02584 |
Messages collided when the message delivery confirmation facility was being used. The connection is released. |
- If the remote system releases the connection when the statement sends a message to the remote system, depending on the length of the message, the statement might not be able to detect that the connection has been released. The following describes what occurs in this case according to the facility used.
- When the message assembly facility is used:
- If CBLDCCLS('ASMSEND ') fails to detect the release of a connection when it sends a message, a subsequent request statement might detect the release. This must be kept in mind when you create a CUP.
- When the message delivery confirmation facility is used:
- If CBLDCCLS('ASMSEND ') fails to detect the release of a connection when it sends a message, the statement detects the release when it receives response-only data.
- If the message assembly and message delivery confirmation facilities are used, short packets are used for sending and receiving. As a result, transmission processing might take more time. If more time might be required, specify Y for DCCLTTCPNODELAY of the client environment definition.
All Rights Reserved. Copyright (C) 2006, 2009, Hitachi, Ltd.