Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Program structure

PL/I is a block-structured language, consisting of packages, procedures, begin-blocks, statements, expressions, and built-in functions.

A PL/I application consists of one or more separately loadable entities, known as a load module. Each load module can consist of one or more separately compiled entities, known as a compilation unit (CU). Unless otherwise stated, a program refers to a PL/I application or a compilation unit.

A compilation unit is a PL/I PACKAGE or an external PROCEDURE. Each package can contain zero or more procedures, some or all of which can be exported. A PL/I external or internal procedure contains zero or more blocks. A PL/I block is either a PROCEDURE or a BEGIN block, which contains zero or more statements and/or zero or more blocks.

A PL/I block allows you to produce highly-modular applications, because blocks can contain declarations that define variable names and storage class. Thus, you can restrict the scope of a variable to a single block or a group of blocks, or can make it known throughout the compilation unit or a load module.

By giving you freedom to determine the degree to which a block is self-contained, PL/I makes it possible to produce blocks that many compilation units and applications can share, leading to code reuse.

Figure 2 shows an application structure.

Figure 2. A PL/I application structure
A PL/I application structure

Packages are discussed in Packages.

Procedures are discussed in Procedures.

Begin-blocks are discussed in Begin-blocks.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)