OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCRPC('CLOSE ') - Terminate an application program

Format

PROCEDURE DIVISION specification

CALL  'CBLDCRPC'  USING  unique-name-1

DATA DIVISION specification

01  unique-name-1.
    02  data-name-A    PIC X(8) VALUE 'CLOSE   '.
    02  data-name-B    PIC X(5).
    02  FILLER        PIC X(3).
    02  data-name-C    PIC S9(9) COMP VALUE ZERO.

Description

CBLDCRPC('CLOSE ') closes the environment for using various types of OpenTP1 COBOL-UAP creation programs. OpenTP1 COBOL-UAP creation programs cannot be called after CBLDCRPC('CLOSE ').

CBLDCRPC('CLOSE ') must be called from the main program. Call it only once in the process.

CBLDCRPC('CLOSE ') also informs OpenTP1 of normal termination of a UAP. If a UAP terminates without CBLDCRPC('CLOSE ') called, OpenTP1 assumes that the UAP terminated abnormally. Consequently, the service group might be shut down or the process might be restarted. To make matters worse, various OpenTP1 resources might not be released, which affects the subsequent processing. If CBLDCRPC('OPEN ') is called from any UAP used with OpenTP1, CBLDCRPC('CLOSE ') must be called before the UAP terminates with STOP RUN.

Call CBLDCRPC('CLOSE ') even if CBLDCRPC('OPEN ') returns with an error.

After CBLDCRPC('CLOSE ') is called, CBLDCRPC('OPEN ') cannot be called.

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'CLOSE[Figure]' for the request code indicating UAP termination.

data-name-C

Specify 0.

Data area whose value is returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

Status codes

Status code Explanation
00000 Normal termination.
00301 The value specified for the data-name is invalid.
This error also occurs if the request code (data-name-A) is invalid.
Other than the above An unprecedented error (e.g., program damage) occurred.