OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCDAM('CLOS') - Close a logical file

Format

PROCEDURE DIVISION specification

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

DATA DIVISION specification

01  unique-name-1.
    02  data-name-A    PIC X(8) VALUE 'DCDAMSVC'.
    02  data-name-B    PIC X(5).
    02  FILLER       PIC X(3).
    02  data-name-C    PIC X(8).
    02  FILLER       PIC S9(9) COMP.
    02  FILLER       PIC S9(9) COMP.
    02  data-name-H    PIC S9(9) COMP.
    02  FILLER       PIC X(28).
01  unique-name-2.
    02  data-name-E    PIC X(4) VALUE 'CLOS'.
    02  FILLER       PIC X(1).
    02  FILLER       PIC X(1).
    02  FILLER       PIC X(1).
    02  FILLER       PIC X(1).
    02  data-name-Z    PIC S9(9) COMP VALUE ZERO.

Description

CBLDCDAM ('CLOS') closes logical files.

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'DCDAMSVC' for the interface code used with the DAM file.

data-name-C

Specify a logical file name with up to 8 characters. If the specified logical file name comprises less than 8 characters, pad the remaining portion with space.

data-name-E

Specify VALUE 'CLOS' for the request code indicating that the logical file is closed.

data-name-H

Specify the file descriptor returned when the logical file was opened.

data-name-Z

Specify 0.

Data area to which a value is returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

Status codes

Status code Explanation
00000 The logical file was closed normally.
01600 CBLDCRPC('OPEN ') was not called.
A DAM file opened outside the transaction range is closed within the transaction range. (This error is returned only when accessing a recoverable DAM file.)
'N' is specified for atomic_update in the user service definition. (This error is returned only when accessing a recoverable DAM file.)
CBLDCDAM('STRT') was not called. (This error is returned only when accessing an unrecoverable DAM file.)
The UAP is incorrectly linked as follows:
  • The library (-1tdam) to be used for access to a TAM file using the DAM service API is linked incorrectly.
  • The definition of the resource manager for transaction control object files is incorrect.
01603 The specified file descriptor is not the one which was acquired by opening the file normally.
The DAM file is not open.
01690 The interface code (data-name-A) is invalid.
01691 The request code (data-name-E) is invalid.