The subroutine DKTBNAME can be in one of three operating modes. If the STATUS-BYTE parameter is present, it is either in Query or Manipulate mode. If the STATUS-BYTE parameter is omitted, it is in Flip mode.
Query mode
Query mode is used to discover the type of name you have – Data Table, View, Alternate Index or Alternate Index View. You specify Query mode by entering a question mark (?) in the STATUS-BYTE.
Query mode will return one of the following one byte codes in the STATUS-BYTE (Table 79). The content of the first parameter, TABLE-NAME, is NOT modified.
STATUS-BYTE (input) |
STATUS-BYTE (output) |
First 2 bits of TABLE-NAME (table name is not modified) |
---|---|---|
? |
Blank |
On-On (Data Table name) |
F |
On-Off (View name) |
Manipulate mode
The STATUS-BYTE will determine the action to be performed on the first two bits of the TABLE-NAME (First parameter). Table 80 shows the values of STATUS-BYTE and the result for Manipulate mode.
STATUS-BYTE (input) |
Setting of first 2 bits of TABLE-NAME (after manipulation) |
---|---|
blank |
On-On (Data Table name) |
F |
On-Off (View name) |
A |
Off-On (Alternate Index name) |
X |
Off-Off (Alternate Index View name) |
1 |
First bit on, second bit as is. |
2 |
Second bit on, first bit as is. |
Flip mode
When the STATUS-BYTE parameter is omitted, the second bit of the table name is flipped from On to Off; or from Off to On. In essence, the table name is flipped from a Data Table to a View, or vice versa.