Divert (Existing) Table (DW)

Command title

Divert Table to a library that already contains a table with the same name

Description

This command causes any subsequent store of the table to be targeted to the tableBASE library specified in the DDNAME parameter. Unlike DV, DW is used when the targeted library already contains a table with the same name, in which case an ST command causes the specified table in a TSR to be stored as a new generation of a table in the target tableBASE library.

COBOL syntax

MOVE 'DW'                   TO xxxx-COMMAND.
CALL 'DK1TCALL' USING        TB-PARM
                            xxxx-COMMAND-AREA
                            DDNAME.

Parameters

DDNAME

Explanation

If the table on the target library has a write password, then the table being Diverted must have the same write password. If the table on the target library does not have a write password, and the table being Diverted does have a write password, then this write password will be removed.

DW allows a new table (either newly created or new by virtue of a Change Name command) to be stored into a tableBASE library which already has a table by that name.

DW also allows a table to be opened from one library, and stored to another library.

Return value

Error code 40 subcode 1 occurs if the DDNAME does not exist.

Error code 31 occurs if the table being diverted does not contain the identical write password as the target table.

Error code 09 subcode 3 occurs if table does not exist on the target library.

Notes

None

Exceptions

None

See also

Divert (Non-existing) Table (DV)

Store Table (ST)

DDNAME (8 bytes)