Previous Topic: Stand-Alone TablesNext Topic: Examples


Overview

Stand-alone tables can be associated with any record element at map-definition time. Stand-alone tables are typically used to list values when:

A stand-alone table is defined and generated by the TABLE statement of DDDL. Clauses in the TABLE statement determine the search technique, arrangement of values, and the type of values for a table as follows.

Search Technique

The search technique used for the table is determined by the SEARCH IS LINEAR/BINARY clause, as follows:

Clause

Description

SEARCH IS LINEAR

Specifies that a linear search algorithm is used for the table. The following considerations apply to linear searches:

  • A linear search progresses sequentially through the table; the first value in the table is examined first, the second value second, and so forth, until either the target value is found or the end of the table is reached.
  • The arrangement of values in the table, as established by the SORTED/UNSORTED parameter discussed later in this section, determines the order of values in the table and, thus, the order of the search.

SEARCH IS BINARY

Specifies that the table is searched with a binary search algorithm. The following considerations apply to binary searches:

  • A binary search compares the target value against the table's midpoint value and determines which half of the table contains the target value. The selected portion then is halved in the same way; this process is repeated until either the target value is found or the end of the table is reached.
  • When SEARCH IS BINARY is specified, values in the table are kept in sorted order, regardless of the SORTED/UNSORTED specification for the table. The SORTED/UNSORTED parameter is discussed later in this section.
  • Binary searching cannot be performed on an edit table that contains ranges, since binary searching requires all values in the table are the same length.
  • A binary search in a code table can be specified for either an encoded value or a decoded value (as specified in the ON ENCODE/DECODE parameter of the SEARCH IS BINARY clause), but not for both. If binary searching is performed for encode values, decode values are searched linearly; if binary searching is performed for decode values, encode values are searched linearly.

Arrangement of Values in the Table

The arrangement of values in the table is determined by the TABLE IS SORTED/UNSORTED clause, as follows:

Clause

Description

TABLE IS SORTED

Specifies that values in the table are sorted in ascending order according to the EBCDIC collating sequence. The following considerations apply:

  • An edit table of ranges is sorted according to the lowest value in the range
  • A code table is sorted according to its encoded values

TABLE IS UNSORTED

Specifies that values in the table are not sorted; the table is stored in the order of its appearance in the defining TABLE statement.

Type of Values in the Table

The type of values in the table is specified by the TABLE DATA IS NUMERIC/ALPHANUMERIC clause. This specification affects the results of a table search. For example, the validity of the value 20b (where the b character denotes the blank character) depends on the type of values specified for the table:

Where are Load Modules Stored?

Load modules for stand-alone tables are stored in the DDLDCLOD area of the data dictionary.

Note: For more information about DDDL syntax and syntax rules, see the CA IDMS IDD DDDL Reference Guide.

Linked vs Unlinked

The map developer specifies whether a stand-alone table is linked or unlinked when enabling the table:

It is often preferable to enable stand-alone tables as unlinked tables since stand-alone tables are typically used as general-purpose tables for several record elements.

Compiling, Generating, Loading of maps

Linked Stand-alone Tables

The compilation and runtime loading of a map that uses linked stand-alone tables are illustrated in the following drawing.

A linked stand-alone table becomes part of a map load module that uses it; the map load module must be recompiled if a linked table is changed.

Unlinked Stand-alone Tables

An unlinked stand-alone table is used by a map, but is not part of the map load module; changes to an unlinked table do not affect map load modules that use the table.