nld Manual

nld Utility
nld Manual528272-001
2-29
Local and Shared Symbols
Local and Shared Symbols
A local symbol is known only within a single compilation unit. A shared symbol is
known by all compilation units that are linked together.
A local symbol is distinct from any other symbol of the same name that appears in
other compilation units. Because a shared symbol is known by all compilation units that
are linked together, all compilation units refer to the same symbol at run time, as
summarized in Table 2-6 on page 2-29.
The pTAL compiler has various rules for grouping data items into blocks. It is possible
to declare separate data items in pTAL, outside explicit data blocks, and have them
remain individual data items across separate compilation units. (This behavior is
identical to that in C and C++.) The pTAL compiler can also group data items together
into a single data block named _GLOBAL. The pTAL compiler can also put the prefix “$
on the name of a data block. For details on declaring and sharing data blocks in pTAL,
see the pTAL Reference Manual.
Table 2-6. Local and Shared Symbols by Language
Language Local Symbols: Names of ... Shared Symbols: Names of ...
C
C++
Static data items
Static functions
Data items declared outside
functions
All other functions
COBOL Data records (level 01 data items) that
are not declared external
Subordinate data items (levels 02-nn )
Programs nested within other
programs
External data items
External file connectors
pTAL Private data blocks whose NAME
declarations are unique
Subprocedures
Names of data block members*
All other data blocks
* For example, if a data block is named B and it contains an integer named I, then B is the only name that nld
considers for separate compilation rules. It is possible that B will be confused with a data item named B in C
compilation units.