external LDA/PDA are similar to Copycode.
LOCAL USING LDA is a shorthand for
and enables reusage of data definitions and initializations.
A saved only data area can not be included into the program. It must be stowed. What does it mean to stow a data area? In early versions of Natural for Unix the STOW did the following:
- Syntax check the “comments” in the source code (comments are the parts of the source code the editor works on)
- Add a DEFINE DATA LOCAL/PARAMETER statement to the source code defining all the data
- Save the modified source code, no compiled object!
- Mark the object as “compiled” in the filedir.sag.
If you then saved the object again, the DEFINE DATA got lost, but the compile flag did not. At compile time, the compiler complained about an empty object.
Today a compiled object is created in Unix, too. This compiled object does also contain nothing else but a DEFINE DATA, but I think, not in a human readable format (can’t check now).
The only data area that behaves like a “program” is the GDA. A GDA is not incorporated into the object code of the using program, but only a reference to it. That’s the reason, why a GDA must be available at runtime.