Divert (Non-existing) Table (DV)

Command title

Divert Table to a library which does not contain the table


This command causes any subsequent store of the table to be targeted to the tableBASE library specified in the DDNAME parameter—unlike DW, DV is used when the targeted directory does not yet contain a copy of the table.

COBOL syntax               

MOVE 'DV'                   TO xxxx-COMMAND.

C syntax

memcpy( tbCommArea.tbCommand, "DV", 2 );
TBLBASE( &tbParm, &tbCommArea, pDDName );




This command does not actually store the table; the store must be explicitly performed by issuing an ST command. In batch using a local TSR, if the table was opened with an OR, the DV command promotes the Table to Open for Write and allows the table to be stored. In an online interface, batch multitasking or multitasking environment such as a VTS-TSR, the table must be open for write before issuing the DV.

If the DV is not successful, the DDNAME and DSN will be blank, and the table will be treated like a defined (DT) table.

Return value

Error 0040 subcode 1 occurs if the DDNAME does not exist.


In prior releases, the DV command did not check whether the target DDNAME was allocated. tableBASE put the target DDNAME in the table definition even if the target DDNAME was not allocated. Subsequent Store commands would fail with return code 40. Starting with Version 6, tableBASE checks to see that the target DDNAME is allocated and returns an error code 40-1 if it is not. The table is then treated like a defined (DT) table.



See also

Divert (Existing) Table (DW)

Store Table (ST)