Previous Topic: SYSTEM (SUBSYSTEM)Next Topic: TASK


TABLE

TABLE statements are used to document edit and code tables. Tables are used by the CA IDMS mapping facility for automatic editing and error handling. Optional TABLE statement clauses relate tables to maps, users, systems, modules, and other tables; establish attribute/entity relationships; and maintain documentation entries.

If the SET OPTIONS statement specifies SECURITY FOR IDD IS ON, the user must be assigned the proper authority to issue TABLE statements.

Syntax

TABLE statement

►►─┬─ ADD ─────┬─ TABle name is table-name ───────────────────────────────────►
   ├─ MODify ──┤
   ├─ REPlace ─┤
   └─ DELete ──┘

 ►─┬────────────────────────────────────────────┬─────────────────────────────►
   └─ Version is ─┬─ version-number ──────────┬─┘
                  └─┬─────────┬─┬─ HIGhest ─┬─┘
                    └─ NEXt ──┘ └─ LOWest ──┘

 ►─┬──────────────────────────────────────────────┬───────────────────────────►
   └─ LANguage is TABLE ─┬──────────────────────┬─┘
                         └─ TEXt is user-text ──┘
 ►─┬─────────────────────────────────────────────────────────┬────────────────►
   └─┬─ PREpared ─┬─ by user-id ──┬────────────────────────┬─┘
     └─ REVised ──┘               └─ PASsword is password ─┘

 ►─┬────────────────────────────────────────────────────────────────────────┬─►─
   └─ SAMe as ─┬ TABle table-name ───┬──┬──────────────────────────────────┬┘
               └ MODule module-name ─┘  └ Version is ─┬─ version-number ─┬─┘
                                                      ├─ HIGhest ────────┤
                                                      └─ LOWest ─────────┘

─►──────────────────────────┬─────────────────────────────────────────────────►
  ─┬──────────────────────┬─┘
   └─ LANguage is TABLE ──┘
 ►─┬─────────────────────────────────────────────────────────────────┬────────►─
   └─ COPy ─┬─ ALL COMments TYPes ─┬─ FROm ─┬─ TABle table-name ───┬─┘
            ├─ COMments ───────────┤        └─ MODule module-name ─┘
            ├─ DEFinition ─────────┤
            ├─ ATTributes ─────────┤
            ├─ SOUrce text ────────┤
            ├─ SYStems ────────────┤
            ├─ USERS ──────────────┤
            ├─ MODULes ────────────┤
            ├─ TABles ─────────────┤
            ├─ comment-key ────────┤
            └─ relational-key ─────┘

─►─────────────────────────────────────────────────────────────────┬──────────►
  ─┬────────────────────────────────────┬─┬──────────────────────┬─┘
   └─ Version is ─┬─ version-number ──┬─┘ └─ LANguage is TABLE ──┘
                  ├─ HIGhest ─────────┤
                  └─ LOWest ──────────┘
 ►─┬────────────────────────────┬─┬──────────────────────────────────────┬────►
   └ NEW NAMe is new-table-name ┘ └ Version is ─┬─ version-number ─────┬─┘
                                                └─ NEXt ─┬─ HIGhest ─┬─┘
                                                         └─ LOWest ──┘

 ►─┬───────────────────────────────────────────┬──────────────────────────────►
   └─ NEW Version is ─┬─ new-version-number ─┬─┘
                      └─ NEXt ─┬─ HIGhest ─┬─┘
                               └─ LOWest ──┘

 ►─┬────────────────────────────────────────────────┬─────────────────────────►
   └─┬─────────┬─ DEScription is description-text ──┘
     └─ table ─┘
   ┌─────────────────────────────────────────────────────────────────┐
 ►─▼─┬─────────────────────────────────────────────────────────────┬─┴────────►
     └─┬─ INClude ◄ ─┬─ USEr is user-id ──┬──────────────────────┬─┘
       └─ EXClude ───┘                    └─ user-specification ─┘

(for complete user-specification syntax, see USER clause)

 ►─┬──────────────────────────────────────────────────────┬───────────────────►
   └─ PUBlic access is ─┬───────────┬─ for ─┬─ ALL ◄ ───┬─┘
                        └─ ALLOwed ─┘       ├─ NONe ────┤
                                            ├─ UPDate ──┤
                                            ├─ MODify ──┤
                                            ├─ REPlace ─┤
                                            ├─ DELete ──┤
                                            └─ DISplay ─┘
 ►─┬──────────────────────────────────────────────────────────────────────────►─
   └─┬─ INClude ◄ ──┬─ WIThin ─┬─ SYStem ────┬─ system-name ──────────────────
     └─ EXClude ────┘          └─ SUBSYstem ─┘

─►────────────────────────────────────────────────────────────────┬───────────►
  ─┬───────────────────────────────────┬─┬──────────────────────┬─┘
   └─ Version is ─┬─ version-number ─┬─┘ └─ TEXt is user-text ──┘
                  ├─ HIGhest ────────┤
                  └─ LOWest ─────────┘

   ┌────────────────────────────────────────────────────────────────────────┐
 ►─▼┬──────────────────────────────────────────────────────────────────────┬┴─►
    └┬ INClude ◄ ┬─┬ MODE ───────┬ is attribute-name ─┬───────────────────┬┘
     └ EXClude ──┘ └ class-name ─┘                    └ TEXt is user-text ┘
   ┌──────────────────────────────────────────────────────────────────────────
 ►─▼─┬────────────────────────────────────────────────────────────────────────►─
     └─┬─ INClude ◄ ─┬─ relational-key is ─┬─ table-name ──┬──────────────────
       └─ EXClude ───┘                     └─ module-name ─┘

  ────────────────────────────────────────────────────────────────────────────
─►────────────────────────────────────────────────────────────────────────────►─
  ─┬──────────────────────────────┬───────────────────────────────────────────
   └ Version is ┬ version-number ┬┘
                ├ HIGhest ───────┤
                └ LOWest ────────┘

  ────────────────────────────────────────────────────┐
─►──────────────────────────────────────────────────┬─┴───────────────────────►
  ─┬─────────────────────┬─┬─────────────────────┬──┘
   └─ LANguage is TABLE ─┘ └─ TEXt is user-text ─┘
   ┌──────────────────────────────────────────────────────────────────────────
 ►─▼─┬────────────────────────────────────────────────────────────────────────►─
     └─┬─ INClude ◄ ─┬─ MAP map-name ─────────────────────────────────────────
       └─ EXClude ───┘

  ─────────────────────────────────────────────────────────────────┐
─►───────────────────────────────────────────────────────────────┬─┴──────────►
  ─┬───────────────────────────────────┬─┬─────────────────────┬─┘
   └─ Version is ─┬─ version-number ─┬─┘ └─ TEXt is user-text ─┘
                  ├─ HIGhest ────────┤
                  └─ LOWest ─────────┘

   ┌───────────────────────────────────────────────────────────────┐
 ►─▼─┬───────────────────────────────────────────────────────────┬─┴──────────►
     │                            ┌────────────────────┐         │
     └─ EDIt ─┬─ COMments ────┬───▼─ edit-instruction ─┴─ QUIT ──┘
              ├─ DEFinition ──┤
              └─ comment-key ─┘
   ┌──────────────────────────────────────────────────┐
 ►─▼─┬─────────────────────────────────────────────┬──┴───────────────────────►
     └─┬─ COMments ─────┬── is ─┬─ NULl ─────────┬─┘
       ├─ DEFinition ───┤       └─ comment-text ─┘
       └─ comment-key ──┘

 ►─┬────────────────────────────────────┬─────────────────────────────────────►
   └─ TYPe is ─┬─ EDIt ─┬───────────┬─┬─┘
               │        ├─ VALid ◄ ─┤ │
               │        └─ INValid ─┘ │
               └─ CODe ───────────────┘

 ►─┬──────────────────────────────────────────────────┬───────────────────────►
   └─ SEArch is ─┬─ LINear ◄ ───────────────────────┬─┘
                 └─ BINary ─┬─────────────────────┬─┘
                            └─ ON ─┬─ ENCode ◄ ─┬─┘
                                   └─ DECode ───┘
 ►─┬──────────────────────────────────────────────────────────────────────────►─
   └─┬─ TABle ──┬─ DATa is ───────────────────────────────────────────────────
     ├─ ENCode ─┤
     └─ DECode ─┘

─►─────────────────────────────────────────────────────────────────────────┬──►
  ─┬─ ALPhanumeric ◄ ────────────────────────────────────────────────────┬─┘
   ├─ NUMERIc ─┬───────────────────────────────────────────────────────┬─┤
   │           └─ DECimal position is ─┬─ 0 ◄ ────────────────────────┬┘ │
   │                                   └─ decimal-position-indicator ─┘  │
   └─ GRAphics ──────────────────────────────────────────────────────────┘

 ►─┬─────────────────────────────┬────────────────────────────────────────────►
   └─ TABle is ─┬─ UNSorted ◄ ─┬─┘
                └─ SORted ─────┘
 ►─┬────────────────────────────────────┬─────────────────────────────────────►
   └─ DUPlicates are ─┬─ ALLowed ◄ ───┬─┘
                      └─ NOT ALLowed ─┘

   ┌────────────────────────────────────────────────────────────────────────┐
 ►─▼─┬────────────────────────────────────────────────────────────────────┬─┴─►
     └┬ INClude ◄┬ VALues ┬ are ┬─┬ LIST ───────────────────────────────┬─┘
      └ EXClude ─┘        └ is ─┘ │  ┌───────────────────────────────┐  │
                                  ├ (▼─┬ value ┬─────────────┬──────┬┴)─┤
                                  │    │       └─ THRu value ┘      │   │
                                  │    └ encode-value  decode-value ┘   │
                                  └  NULl ──────────────────────────────┘

 ►─┬─────────────┬────────────────────────────────────────────────────────────►◄
   └─ GENerate ──┘

DISPLAY/PUNCH TABLE (for a single table)

►►─┬─ DISplay ─┬─ TABle name is table-name ───────────────────────────────────►
   └─ PUNch ───┘

 ►─┬───────────────────────────────────┬──────────────────────────────────────►
   └─ Version is ─┬─ version-number ─┬─┘
                  ├─ HIGhest ────────┤
                  └─ LOWest ─────────┘

 ►─┬──────────────────────┬───────────────────────────────────────────────────►
   └─ LANguage is TABLE ──┘
 ►─┬───────────────────────────────────────────────────┬──────────────────────►
   └─ PREpared by user-id ─┬─────────────────────────┬─┘
                           └─ PASsword is password ──┘

   ┌────────────────────────────────────────────────────────┐
 ►─▼─┬────────────────────────────────────────────────────┬─┴─────────────────►
     │                ┌─────────────────────────────────┐ │
     ├─ WITh ──────┬──▼──┬─ ALL ─────────────────────┬──┴─┘
     ├─ ALSo WITh ─┤     ├─ ALL COMment TYPes ───────┤
     └─ WITHOut ───┘     ├─ ATTributes ──────────────┤
                         ├─ COMments ────────────────┤
                         ├─ DEFinitions ─────────────┤
                         ├─ DETails ─────────────────┤
                         ├─ HIStory ─────────────────┤
                         ├─ MAPs ────────────────────┤
                         ├─ MODules ─┬────────┬──────┤
                         │           └─ ONLy ─┘      │
                         ├─ MODule SOUrce ───────────┤
                         ├─ NONe ────────────────────┤
                         ├─ PROCesses ───────────────┤
                         ├─ PROgrams ────────────────┤
                         ├─ QFIles ──────────────────┤
                         ├─ SAMe AS ─────────────────┤
                         ├─┬─ SYStems ────┬──────────┤
                         │ └─ SUBSYstems ─┘          │
                         ├─ TABles ──────────────────┤
                         ├─ USErs ───────────────────┤
                         ├─┬─ USEr DEFINED COMments ┬┤
                         │ └─ UDCs ─────────────────┘│
                         ├─┬─ USEr DEFINED NESts ─┬──┤
                         │ └─ UDNs ───────────────┘  │
                         └─ WHEre USED ──────────────┘
 ►─┬──────────────────────────────────────────────────────────────────────────►─
   └─ TO ─┬─ SYSpch ──────────────────────────────────────────────────────────
          └─ MODule module-name ─┬───────────────────────────────────┬────────
                                 └─ Version is ─┬─ version-number ─┬─┘
                                                ├─ HIGhest ────────┤
                                                └─ LOWest ─────────┘

─►──────────────────────────────────────────────────────────────────────────┬─►
  ─────────────────────────────────────────────────────────────────────────┬┘
  ─┬──────────────────────┬┬──────────────────────────────────────────────┬┘
   └ LANguage is language ┘└ PREpared by user-id ┬───────────────────────┬┘
                                                 └ PASsword is password ─┘

 ►─┬──────────────────────┬──┬─────────────────────┬──────────────────────────►◄
   └─ VERB ─┬─ DISplay ─┬─┘  └─ AS ─┬─ SYNtax ───┬─┘
            ├─ PUNch ───┤           └─ COMments ─┘
            ├─ ADD ─────┤
            ├─ MODify ──┤
            ├─ REPlace ─┤
            └─ DELete ──┘

DISPLAY/PUNCH TABLE (for multiple tables)

►►─┬─ DISplay ─┬─┬─ ALL ──────────────────────────┬─ TABles ──────────────────►
   └─ PUNch ───┘ └─┬─ FIRst ─┬─┬─ 1 ◄ ──────────┬─┘
                   ├─ NEXt ──┤ └─ entity-count ─┘
                   ├─ LASt ──┤
                   └─ PRIor ─┘

 ►─┬──────────────────────────────────────────────────┬───────────────────────►
   └─ PREpared by user-id ─┬────────────────────────┬─┘
                           └─ PASsword is password ─┘

 ►─┬─────────────────────────────────┬────────────────────────────────────────►
   └─ WHEre conditional-expression ──┘

(for complete conditional-expression syntax, see WHERE clause)
 ►─┬──────────────────┬───────────────────────────────────────────────────────►
   └─ BY ─┬─ SET ◄ ─┬─┘
          └─ AREa ──┘

 ►─┬──────────────────────────────────────────────────────────────────────────►─
   └─ TO ─┬─ SYSpch ──────────────────────────────────────────────────────────
          └─ MODule module-name ─┬───────────────────────────────────┬────────
                                 └─ Version is ─┬─ version-number ─┬─┘
                                                ├─ HIGhest ────────┤
                                                └─ LOWest ─────────┘
─►──────────────────────────────────────────────────────────────────────────┬─►
  ─────────────────────────────────────────────────────────────────────────┬┘
  ─┬──────────────────────┬┬──────────────────────────────────────────────┬┘
   └ LANguage is language ┘└ PREpared by user-id ┬───────────────────────┬┘
                                                 └ PASsword is password ─┘
 ►─┬──────────────────────┬──┬──────────────────────────────────────┬─────────►◄
   └─ VERB ─┬─ DISplay ─┬─┘  └─ AS ─┬─ SYNtax ───┬──┬─────────────┬─┘
            ├─ PUNch ───┤           └─ COMments ─┘  └─ RECursive ─┘
            ├─ ADD ─────┤
            ├─ MODify ──┤
            ├─ REPlace ─┤
            └─ DELete ──┘

Parameters

TABle name is table-name

Identifies a new table to be established in the dictionary, or an existing occurrence to be modified, replaced, deleted, displayed, or punched. Table-name must be a 1- through 8-character alphanumeric value. The specified name must not duplicate the name of an existing program, map, subschema, or CA ADS dialog.

LANguage is

Qualifies the requested table/module with a language. The LANGUAGE specification uniquely identifies two modules with the same name and version and is used by the DML precompilers when modules are used in programs.

TABLE

When used with the LANGUAGE IS clause, supplies the appropriate language, TABLE, automatically.

SAMe as TABle/MODule table-name/module-name

Copies all entries associated with the named table or module, except the name and LANGUAGE specifications. The table/module to be copied must have the language TABLE.

COPy entity-option FROm entity-type-name entity-occurrence-name

Copies selected options from an entity-occurrence definition and merges the copied options into this definition. TABLEs can copy only from other modules with a language of TABLE.

NEW NAMe is new-table-name

Specifies a new name for the requested table. This clause changes only the name of the table; it does not alter or delete any previously defined relationships in which the table participates. Subsequent references to the table must specify the new name. New-table-name must be a 1- through 8-character alphanumeric value. The concatenation of the new table name, version number, and language must not duplicate that of an established table or module occurrence.

NEW Version is new-version/NEXt HIGhest/NEXt LOWest

Specifies a new version number for the named table. The combination of the table name, new version number, and language qualification must not duplicate that of an existing table or module.

WIThin SYStem/SUBSYstem system-name

Associates the requested table with (INCLUDE) or disassociates it from (EXCLUDE) the specified system or subsystem. System-name must reference an existing system or subsystem.

relational-key is table-name/module-name

Associates (INCLUDE) the table with or disassociates it from (EXCLUDE) another table or module by means of the named relational key. If the tables and/or modules being related have the same name and version but different languages, or if the related module has a version of HIGHEST or LOWEST and is qualified by language, the LANGUAGE parameter must be specified. For a complete description of defining and using relational keys, see Relational Keys.

MAP map-name

Associates (INCLUDE) the table with or disassociates (EXCLUDE) it from a map. Map-name must reference an existing map.

TYPe is

Specifies the table type. This clause is required for ADD operations.

EDIt

Defines a table that contains a list of values or ranges of values; a data field will be checked against the table.

VALid/INValid

Specifies whether the list contains valid or invalid values; VALID is the default.

CODe

Defines a table that translates internal codes in a record to external report values (decoding) or maps external values back to internal record codes (encoding).

SEArch is

Specifies the method by which the table is to be searched.

LINear

Starts the search at the beginning of the table and proceeds line by line until the specified value is found. LINEAR is the default.

BINary

Starts the search in the middle of the table and halves the table each time a comparison is made until the specified value is found. Edit tables to be searched by the binary method can include only single values.

ON ENCode/DECode

Specifies whether the binary search is to be performed on encoded or decoded table values. (The option is for code tables only.) The default is ENCODE.

TABle/ENCode/DECode DATa is

Specifies the type of table. DECODE allows different types of encode and decode values.

ALPhanumeric

Specifies that the corresponding table values in the value list are one of the following types of literals:

The character strings must be enclosed in the site-specific quote character. ALPHANUMERIC is the default.

NUMeric

Specifies numeric data.

GRAphics

Specifies that the corresponding table values in the value list are graphic (G-) literals. You use G-literals when an element must be interpreted without the shift codes. The external picture of the data element must be X, unless the table is to be used with mapping. In this case, the external picture of the data element must be G.

More information: For more information about using graphics literals, see Double-Byte Character Set (DBCS) Strings.

DECimal position is

Specifies the position of the decimal point (NUMERIC option only). Note that this is an assumed decimal position; no decimal point appears in the values.

TABle is

Specifies whether the table is to be maintained in the dictionary as a sorted table.

UNSorted

Sorts table values at runtime in the order in which they are placed in the dictionary. UNSORTED is the default.

SORted

Sorts table values alphabetically or numerically as they are added to the table.

Note: A binary searched table can be stored with the UNSORTED attribute; however, the table is automatically sorted when it is generated.

DUPlicates are ALLowed/NOT ALLowed

Specifies whether duplicate values can be included in sorted tables; ALLOWED is the default. Note that DUPLICATES ARE NOT ALLOWED must be specified for binary searched tables.

VALues are

Specifies whether table values are to be listed, inserted, or removed.

LIST

Lists the table values or pairs of values (code tables only) stored in the dictionary.

value THRu value

Inserts single values, ranges of values, combinations of single values and ranges, or null values in the edit table. Value must be a 1- through 34-character value and must be enclosed in parentheses.

encode-value decode-value

Specifies pairs of values to be inserted in the code table. Encode-value must be a 1- through 34-character value; decode-value must be a 1- through 62-character value. The specified values must be enclosed in parentheses.

NOT FOUND is a condition to be acted upon and may be used as an encode-value or as an decode-value or as both (refer to the CA IDMS Mapping Facility Guide document for more information).

NULl

Removes all values from the table.

GENerate

Causes a load module containing all the values in the table to be placed in the dictionary load area. The generated load module has the same name and version number as the named table.

WITh/ALSo WITh/WITHOut

Includes or excludes the specified options when the specified table is displayed or punched. Detailed information for each DISPLAY/PUNCH option is under SET OPTIONS Syntax. The option that is listed below presents special considerations for this entity type.

DETails

Includes table data.

Usage

TABLE statement considerations

The following considerations apply to TABLE:

If you specify REPLACE

If you specify REPLACE, the DDDL compiler initializes to defaults and/or excludes the following options:

The following relationships are not affected:

Cross-referencing maps and tables

You can add cross-referencing from a table to any MAP (maps used by the CA IDMS mapping facility or documentation IDD maps). You must remove all cross-referencing before you can delete a table.

Example

The following statements add tables MONTHTBL and DECODMTH. MONTHTBL is an edit table that contains the valid values 1 through 12 for the months of the year; DECODMTH is a code table that relates the names of the months to the 2-digit month codes used in the database:

add table name is monthtbl
    table description is 'valid months'
    type is edit
    search is linear
    table data is alphanumeric
    table is unsorted
    values are ( 01 thru 12 )
    .

add table name is decodmth
    table description is 'month code convert'
    type is code
    search is linear
    encode data is alphanumeric
    table is unsorted
    duplicates are allowed
    values are ( 01 jan 02 feb 03 mar 04 apr
         05 may 06 jun 06 june 07 jul 07 july
         08 aug 09 sep 10 oct 11 nov 12 dec
         not found other )
    .