OpenTP1 Version 7 Programming Reference COBOL Language

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

SEND - Execute an operation command

Format

DATA DIVISION (communication description entry) specification

CD  communication-description-name
    FOR {OUTPUT|I-O} COMMAND
    [STATUS  KEY  IS  data-name-1].
 
01 unique-name-1.
   02 data-name-2  PIC  9(4) COMP.
   02 data-name-3  PIC  X(2) VALUE LOW-VALUE.
   02 data-name-4  PIC  X(n).
01 unique-name-2.
   02 data-name-5  PIC  9(4) COMP.
   02 data-name-6  PIC  X(2) VALUE LOW-VALUE.
   02 data-name-7  PIC  X(n).

PROCEDURE DIVISION specification

SEND  communication-description-name  FROM  unique-name-1
     [BEFORE  RECEIVING  MESSAGE  INTO  unique-name-2] .

Description

SEND enables the following CALL interface facility:

Note the following points on using commands with DML unlike when using CALL interface commands:

Items specified in the communication description entry

FOR clause

Specify either of the following value.

OUTPUT COMMAND: Specify OUTPUT COMMAND when not receiving the command execution results output to the standard error output file. When this value is specified, 0 is assumed for the length of the area for receiving data output to the standard error output file.

I-O COMMAND: Specify I-O COMMAND when receiving the command execution results output to the standard error output file.

STATUS KEY clause

Specify this clause to receive a status code. If this clause is omitted, a status code cannot be received.

Items specified in the communication statement

unique-name-1

This area is used to specify the command to be executed by using SEND statement. The following figure shows the format for specifying the character string of the command:

[Figure]

BEFORE clause

Specify this clause to receive the character string output to the standard error output file when the command is executed. The BEFORE clause must be specified when I-O command is specified for the FOR clause.

unique-name-2: Data item for storing the character string output to the standard error output file. A character string which can be stored is up to (unique-name-2 area length) - 4. The excess portion is truncated.

The following figure shows the format of the receive character string (unique-name-2):

[Figure]

Status codes

Status code Explanation
00000 The shell termination code is 0 (normal termination of command execution). When I-O COMMAND was specified for the FOR clause, the character string output to the standard error output file was stored.
01801 The shell termination code is not 0 (abnormal termination of command execution). When I-O COMMAND was specified for the FOR clause, the character string output to the standard error output file was stored.
01802 The value specified for the data-name is invalid. Verify that there are no errors in the area length specification set in unique name 1 and unique name 2 and in locations where 0 must be specified.
01803 Data was output to the standard output file. (This statement cannot receive the character string output to the standard output file.)
01804 The data output to the standard error output file was too large to be stored in the area.
01805 Data was output to the standard output file (this statement cannot receive the character string output to the standard output file), and the data output to the standard error output file was too large to be stored in the area.
01806 A system call (close, pipe, dup, or read) could not be used.
01807 CBLDCRPC('OPEN ') was not called.
01808 The memory became insufficient.