OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCDMB('CRAT') - Allocate 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  data-name-D    PIC S9(9) COMP.
    02  data-name-E    PIC S9(9) COMP.
    02  data-name-G    PIC S9(9) COMP.
    02  data-name-H    PIC S9(9) COMP.
01  unique-name-2.
    02  data-name-F    PIC X(4) VALUE 'CRAT'.
    02  data-name-I     PIC X(1).
    02  data-name-J     PIC X(1).
    02  data-name-K    PIC X(1).
    02  FILLER        PIC X(1).
    02  data-name-Z    PIC S9(9) COMP VALUE ZERO.

Description

CBLDCDMB('CRAT') allocates a physical file to the OpenTP1 file system.

The size of a physical file is (block length + 8) x (number of blocks + 1).

There is no need to open the physical file after the physical file is allocated.

The following COBOL-UAP creation programs cannot be called after the physical file is allocated by CBLDCDMB('CRAT'):

The size of an output buffer is (block length + 8) x (number of blocks collectively processed).

The default is assumed if 'N' is specified for access permissions (no access permission).

When allocating a physical file, specify the physical file name.

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 the name of the physical file to be created, with a pathname 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-D

Specify the length of a block to be allocated in the OpenTP1 file system.

data-name-G

Specify the number of blocks to be allocated in the OpenTP1 file system.

data-name-H

Specify the number of blocks collectively processed which is used as an input/output unit.

data-name-F

Specify VALUE 'CRAT' for the request code indicating physical file allocation.

data-name-I

Specify the access permission of the file owner.

VALUE 'N': No access permission

VALUE 'R': Read permission only

VALUE 'W': Write permission only

VALUE 'B': Both read permission and write permission

data-name-J

Specify the access permission of the file owner group.

VALUE 'N': No access permission

VALUE 'R': Read permission only

VALUE 'W': Write permission only

VALUE 'B': Both read permission and write permission

data-name-K

Specify the access permission of those who are not the file owner.

VALUE 'N': No access permission

VALUE 'R': Read permission only

VALUE 'W': Write permission only

VALUE 'B': Both read permission and write permission

data-name-Z

Specify 0.

Data areas to which values are returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

data-name-E

The file descriptor is returned.

Status codes

Status code Explanation
00000 The file descriptor was specified for data-name-E normally.
01607 The memory became insufficient.
01608 The physical file specified for data-name-C is open.
01611 The value specified for data-name-I, J, or K is invalid.
01614 The physical file name is invalid.
01615 The value specified for the number of blocks collectively processed is invalid.
01617 The same physical file name already exists.
01618 The OpenTP1 file system versions used for creation and allocation do not match each other.
01620 An input/output error occurred.
01628 The access permission for special files has not been granted.
The DAM file to be allocated is protected by the security facility. The UAP that called CBLDCDMB('CRAT') has no access permission.
01630 The value specified for the block length is not suitable.
01631 The value specified for the number of blocks is not suitable.
01632 The physical file is not a character special file, or the device corresponding to the special file does not exist.
01633 The specified OpenTP1 file has not been initialized as an OpenTP1 file system.
01634 When the OpenTP1 file was initialized as an OpenTP1 file system, an attempt was made to allocate more OpenTP1 files (physical files) than specified.
01635 The specified value exceeds the maximum number of files which can be opened in the process being executed.
01636 The physical file specified for data-name-C is being used in online mode, or it is being used by another process.
01640 The OpenTP1 file system does not have a free area large enough to allocate physical files.
01646 The DAM file to be allocated is protected by the security facility. No ACL exists for the file.
01690 The interface code (data-name-A) is invalid.
01691 The request code (data-name-F) is invalid.