Previous Topic: Coding Standards for PL/1 Programs

Next Topic: Declaration of Variables

Program Layout

All programs should follow the standard layout:

Place the program name in a variable at the beginning of the program. This variable should have the same name for every program, for example, @PGMID. Use this variable wherever the program name is needed (for example, on message sending). This makes it easy to rename the program, or to copy code.

Use only one PL/1 statement per line. Use continuous lines to break the program up into its logical sections.

Three characters are assigned standard meanings:

Structured programming constructs should not cross-subsection boundaries; that is, the following should not occur:

The END statement of a procedure should include the procedure name as a label. For example:

Procedures should be separated by ‘%PAGE’ directives.

Procedures should be prefaced by one or two lines of text to indicate their function. This should follow the PROCEDURE statement.

Use the following convention to emphasize the logic:

Indent code to reflect the structured programming constructs. The standard indentation is three characters per level.