OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCDAM('REWT') - Update a logical file block

Format

PROCEDURE DIVISION specification

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

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  data-name-D    PIC S9(9) COMP.
    02  data-name-E    PIC S9(9) COMP.
    02  data-name-H    PIC S9(9) COMP.
    02  FILLER        PIC X(28).
01  unique-name-2.
    02  data-name-F    PIC X(4) VALUE 'REWT'.
    02  data-name-G    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.
    02  unique-name-3.
        03  data-name-I    PIC S9(9) COMP.
        03  data-name-J    PIC S9(9) COMP.
    02  unique-name-4.
        03  data-name-I    PIC S9(9) COMP.
        03  data-name-J    PIC S9(9) COMP.
           :
           :
    02  unique-name-m.
        03  data-name-I    PIC S9(9) COMP.
        03  data-name-J    PIC S9(9) COMP.
01  unique-name-n.
    02  data-name-K    PIC X(n).

Description

CBLDCDAM('REWT') outputs a block, input from the logical file for update processing. CBLDCDAM('REWT') also cancels an update request.

The timing of updating blocks is shown below:

When multiple blocks are specified at a time and if even one of the specified blocks causes an error, processing is stopped and an error is returned. Update processing is not done in this case.

When updating a logical file block, specify the logical file name and the file descriptor returned from CBLDCDAM('OPEN').

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-D

Specify the number of blocks from unique-name-3 to unique-name-m (number of sets of data-name-I and data-name-J).

data-name-E

Specify the length of the update data. The update data length must be equal to or greater than (block length to be updated x number of blocks to be updated).

'Number of blocks to be updated' is the sum of blocks specified with the number of blocks from unique-name-3 to unique-name-m (number of sets of data-name-I and data-name-J).

data-name-H

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

data-name-F

Specify VALUE 'REWT' for the request code indicating the update of a logical file block.

data-name-G

Specify an update request type with VALUE 'U' or VALUE 'C'.

VALUE 'U': Update request

VALUE 'C': Update request cancel

data-name-I

Specify the first relative block number of the block to be accessed.

data-name-J

Specify the last relative block number of the block to be accessed. If 0 is specified, only the relative block number specified for data-name-I is input.

data-name-K

Specify an update data area.

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 All blocks were updated normally.
01600 CBLDCRPC('OPEN ') was not called.
CBLDCDAM('REWT') was called outside 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 file descriptor specified for data-name-H is not the one which was acquired by opening the file normally.
The DAM file is not open.
01604 The update data length (block length to be updated x number of blocks to be updated) is too short.
01605 The logical file block was not input for update processing.
01606 The relative block number is invalid.
01607 The memory became insufficient.
01609 The value specified for data-name-D is smaller than 1.
01611 The value specified for data-name-G is invalid.
01613 The number of block updates exceeded the maximum number of blocks that can be updated during one transaction according to the DAM service definition. (This error is returned only when accessing a recoverable DAM file.)
01620 An output error occurred. (This error is returned only when accessing an unrecoverable DAM file.)
01621 The specified file is in logical shutdown state.
01622 The specified file is in shutdown state due to an error.
01629 The transaction service encountered an error.
(This error is returned only when accessing a recoverable DAM file.)
01641 The update data length (block length to be updated x number of blocks to be updated) is too long.
01690 The interface code (data-name-A) is invalid.
01691 The request code (data-name-F) is invalid.