Get Table Definition (GD)

Command title

Get Table Definition

Description

This command supplies information describing the specified table, including the complete table definition, but excluding the read and write passwords.

COBOL syntax

MOVE 'GD'                   TO xxxx-COMMAND.
CALL 'TBLBASE' USING        TB-PARM
                            xxxx-COMMAND-AREA
                            DEFINITION-BLOCK
                            [GENERATION].

C syntax

memcpy( tbCommArea.tbCommand, "GD", 2 );
TBLBASE( &tbParm, &tbCommArea, &tbTableDefinition,
         nGeneration );

Parameters

DEFINITION-BLOCK

GENERATION (optional)

Explanation

The TSR of record is the local TSR if there is no VTS name in the TB-PARM, otherwise it is the VTS-TSR specified in the TB-PARM.

When the library list is being searched the following occurs:

  • If the TSR of record is a local TSR, both regular and VTS-TSRs on the library list are searched. Processing stops when the table name is found on the first library in the library list.
  • If the TSR of record is a VTS-TSR, only regular libraries on the library list are searched. VTS-TSRs on the library list are bypassed. Processing stops when the table name is found on the first regular library on the library list.
If the GENERATION parameter is not specified the following occurs:

  • If the table is already open in the TSR, the definition for the open generation is returned.
  • If the table is not open, the definition for the current generation is returned from the first library on the library list search sequence that contains the table.
If the GENERATION parameter is specified, the definition is obtained from the library list even if the table is open:

  • If a matching generation of the table is found on a regular library, the definition is returned.
  • If the table is found on a regular library but there is no matching generation number, the definition is not returned and ERROR is set to 8.
  • If the table is found on a VTS-TSR and the TSR of record is a local TSR, the definition is returned even if the generation number does not match.

Return value

The information is returned in the DEFINITION-BLOCK parameter.

If the definition is returned, FOUND is set to Y, otherwise it is set to N.

OPEN-STATUS in the returned definition block is set to X if the table definition is returned from the library list, otherwise it is set to R or W depending on whether the table is opened for read (R) or for write (W) in the TSR.

ERROR is set to 8 if the table is found on a regular library but there is no matching generation number.

The read and write Password fields will be set to blanks if the table has no passwords, or will be set to Xs if the password has been defined for the table.

The command shows the time and date of creation for a temporary table (created by DT or IA). Previous releases showed these values only for tables that were stored on a library.

Notes

For an Alternate Index that is not open, row size is returned as zero.

Exceptions

None

See also

3. FOUND (1 byte)