Remap Reference

Remap references control which embedded remaps a user can reference.

The following diagram illustrates the syntax for a remap reference:

<remap reference>

──┬──────────────────┬─<remap name>─┬───────────┬──────────────────────┤
  └─ <identifier> = ─┘              └─<comment>─┘

Explanation

All remaps of embedded data sets must be declared within the original master data set. Remaps invoke embedded remaps using remap references.

At most, one remap of an embedded data set can be referenced at a time. The following declaration is illegal:

RD3 REMAPS D (RE1;RE2);

The embedded data set can be omitted entirely, as shown in the following declaration:

RD4 REMAPS D (M);

Remap references can only refer to remaps. They must not refer to embedded data sets; thus, the following remap is illegal:

RD5 REMAPS D (E);

The <identifier> = <remap name> syntax can be used to change a remap reference. The identifier name cannot be the same name as another item name in the data set. Also, the embedded data set name cannot be used as an identifier to a remap reference.

The following two examples illustrate the DASDL syntax for remap references.

Example 1

Records RE1, RE2, and RE3 all remap data set E. Each of the records uses a different remap reference. The records are then included in the records RD1, RD2, and RD3, which are remaps of data set D.

D DATA SET
 (
  A ALPHA(2);
  B BOOLEAN;
  E DATA SET
   (
    X REAL;
    Y NUMBER(4);
    Z FIELD(12);
   );
  S SET OF E KEY (Y,Z);
  RE1 REMAPS E (X;Y);
  RE2 REMAPS E (X;Z);
  RE3 REMAPS E (Y;Z);
 );
RD1 REMAPS D
 (
  A;
  B;
  RE1;
  S;
 );
RD2 REMAPS D
 (
  B;
  RX = RE3;
  SX = S;
 );
RD3 REMAPS D
 (
  A;
  RE2;
  S;
 );
RD4 REMAPS D
 (
  A;
  B;
 );

Example 2

Data set D has two remaps, RD1 and RD2. Embedded data set E has two remaps, RE1 and RE2. Note that the remaps of E are defined in D, not in RD1 or RD2. Remaps RD1 and RD2 contain remap references which invoke the appropriate remaps of E.

Embedded remaps are only invoked when a remap that references them is invoked. When a data set is invoked directly, none of the remaps it contains are invoked. For example, if D is invoked, then its items M and E are invoked but RE1 and RE2 are not. However, if RD1 is invoked, then its items M and RE1 are invoked, and the original data set E is not.

D DATA SET
 (
  M ALPHA(10) REQUIRED;
  E UNORDERED DATA SET
   (
    L IS IN D VERIFY ON M;
    R REAL;
    B BOOLEAN;
   );
  RE1 REMAPS E (B; R);
  RE2 REMAPS E (L; B);
 );
RD1 REMAPS D (M; RE1);
RD2 REMAPS D (M; RX = RE2);