COBOL Manual for TNS and TNS/R Programs

HP COBOL Manual for TNS and TNS/R Programs522555-006
2-1
2
Source Program Organization and
Format
The lines of a COBOL source program are organized into divisions. The program ends
with an END PROGRAM statement. Individual lines must follow a reference format that
the compiler accepts. Any line in a source program can contain a COPY statement,
which tells the compiler to insert source text from a specified disk file, called a COPY
library.
A run unit can contain more than one source program. Programs in the same run unit
can share resources with each other. The programs can be nested, which means that
one program contains one or more other programs, which might in turn contain one or
more other programs. A nested program can be common, which means that it can be
called by any other program contained in the program that contains it. Nested
programs are always in the same run unit; therefore, they can share resources.
An initial program is one whose program state is initialized whenever any program in
its run unit calls it.
Topics:
Source Program Components
Reference Format for Source Program Lines
COPY Libraries
Nested Source Programs
Common Programs
Programs in the Same Run Unit
Initial Programs
How Programs Share Resources