Data initialization

EGL handles data initialization as follows:
Note: Circular dependencies between libraries create problems during initialization. A dependency is circular when two libraries contain variables whose initial values depend on variables in the other library, as in the following example:
library lib1
  a int = 1;
  b int = lib2.c;
end

library lib2
  c int = 2;
  d int = lib1.a;
end

If a program attempts to use either lib1 or lib2, EGL throws an exception.

Compatibility

Table 2. Compatibility considerations for data initialization
Platform Issue
COBOL generation

An EGL-generated COBOL program initializes all records. The fields within the records are initialized based upon the COBOL data type, after which the variables are initialized by EGL type as described in the table above, overriding the COBOL INITIALIZE statement.

Note: If you generate a COBOL program that compares a variable of type NUM with a variable of type CHAR, make sure that your code initializes the fields; otherwise, the comparison can cause the program to fail with an abend message. If this happens, no exception-handling code is run. A similar, COBOL-specific warning applies to fields in local records.
JavaScript generation The following types are not supported: ArrayDictionary, BIN (with decimal places), BLOB, CHAR, CLOB, DBCHAR, HEX, INTERVAL, MBCHAR, NUMC, STRING (with a size limit), PACF, UNICODE, and structured Record parts.

Feedback