Database schema in globals

Globals files can define the database schema to be used by the compiler to resolve DEFINE ... LIKE statements.

The schema specification must appear before the GLOBALS keyword starting the globals block.

The schema specification is propagated to the modules including the globals file defining the database schema. These modules can use DEFINE ... LIKE without an explicit SCHEMA instruction.

Further, when using the DATABASE instruction instead of SCHEMA, if the module including the globals contains the MAIN block, the DATABASE specification of the globals file will be propagated and result in an implicit database connection at runtime.

Example

SCHEMA stores
GLOBALS
  DEFINE cust_rec LIKE customer.*
  ...
END GLOBALS