Global data can be redescribed using a global data remap. Global data remaps enable the database administrator to alter the appearance of the global data record and to control how the items in the record are accessed. Global data remaps also provide data independence exactly as remaps do.
Several different remaps can be declared for the global data record. Each global data remap is declared much like a normal data set remap. Global data is automatically invoked when the database is invoked directly; thus, global data remaps can be used only with logical databases. Each logical database can omit global data altogether, it can invoke the actual global data record, or it can invoke a global data remap.
Items need not be declared in the same order in the remap as they were in the original global record. When possible, however, the items should be preserved in the original sequence to improve run-time efficiency.
The following diagrams illustrate the syntax for a global data remap:
<global data remap>
── <global data remap name> REMAPS <database name> ─┬───────────┬──────► └─<comment>─┘ ►─┬────────────────┬─<global data remap record description>────────────┤ └─<remap option>─┘
<remap option>
┌◄───────────────────── , ────────────────────┐ ──┴─┬─/1\─ REQUIRED ALL ──────────────────────┬─┴──────────────────────┤ └─/1\─ READONLY ALL ─┬────────────────────┤ ├─ NO EXCEPTION ─────┤ └─ GIVING EXCEPTION ─┘
<global data remap record description>
┌◄────────────── ; ─────────────┐ ── ( ─┴─┬─<remap data item>─────────┬─┴─┬─────┬─ ) ────────────────────┤ ├─/1\─<filler item>─────────┤ └─ ; ─┘ ├─<remap group item>────────┤ ├─<remap population item>───┤ ├─<remap aggregate item>────┤ ├─<virtual data item>───────┤ ├─<virtual group item>──────┤ └─<virtual population item>─┘
The following table explains the elements of the syntax diagrams:
Example
The following example illustrates the DASDL syntax for a global data remap:
% GLOBAL DATA ITEMS A ALPHA(20); N NUMBER(5,2); P POPULATION(1000) OF D; AG AGGREGATE (12) COUNT (K NEQ BLANKS) OF D; D DATA SET ( K ALPHA(10); ); G REMAPS DBNAME ( X = A; N NUMBER(5,2) INITIALVALUE 100, HIDDEN; AG; V VIRTUAL BOOLEAN = TRUE; Q VIRTUAL POPULATION(100) = 0; );