OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCDMB('CLOS') - Close a physical file

Format

PROCEDURE DIVISION specification

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

DATA DIVISION specification

01  unique-name-1.
    02  data-name-A    PIC X(8) VALUE 'DCDAMINT'.
    02  data-name-B    PIC X(5).
    02  FILLER        PIC X(1).
    02  data-name-C    PIC X(63).
    02  FILLER        PIC X(3).
    02  FILLER        PIC S9(9) COMP.
    02  data-name-E    PIC S9(9) COMP.
    02  FILLER        PIC S9(9) COMP.
    02  FILLER        PIC X(4).
01  unique-name-2.
    02  data-name-D    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

CBLDCDMB('CLOS') closes a physical file created in the OpenTP1 file system.

If a file is not filled with data, the remaining part up to the end of the file is padded with space while the remaining part is padded with blocks of null characters only in the following cases:

When closing a physical file, specify the physical file name and the file descriptor returned from CBLDCDMB('OPEN') or CBLDCDMB('CRAT').

Data areas whose values are set in the UAP

data-name-A

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

data-name-C

Specify a physical file name with a path name which comprises 63 characters (special file name + 14 characters) or less. If the physical file name comprises less than 63 characters, pad the remaining portion with space.

data-name-E

Specify the file descriptor.

data-name-D

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

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 file was closed normally.
01603 The file descriptor specified for data-name-E is not the one which was acquired by opening the file normally.
The DAM file is not open.
01620 An output error occurred.
01690 The interface code (data-name-A) is invalid.
01691 The request code (data-name-D) is invalid.