COBOL examples using DKTBNAME

The following example changes a Data Table name to a View name by omitting the STATUS-BYTE parameter from the call, thus moving into FLIP mode.

   05 WS-TABLE-NAME                     PIC X(8).
   05 WS-STATUS-BYTE                    PIC X.

etc.

   MOVE 'TABLE1' TO                     WS-TABLE-NAME.
   CALL 'DKTBNAME' USING                WS-TABLE-NAME. 
The following example forces a special table name (a View or an Alternate Index View for example) to be converted to a Data Table name. This is often done if the name is to be displayed in upper-case when printed in a message line.

MOVE SPACE TO                           WS-STATUS-BYTE.
CALL 'DKTBNAME' USING                   WS-TABLE-NAME
                                        WS-STATUS-BYTE.