Previous Topic Next topic Print topic


Names

A name used to denote part of a statement such as a verb, option, or clause, is called a keyword. All statements, except the assignment statement, begin with a keyword that identifies the purpose of the statement.

A name can also denote an object operated upon by the program, such as a variable, file, or label. These names are known as identifiers. Their meanings are established by a declaration.

In this example, G and Y are identifiers. READ, FILE, and INTO are keywords.

READ FILE (G) INTO (Y) ;

There are no reserved words in Open PL/I. In this example, TO names a storage location.

GOTO L;
CALL S(B,C,D);
RETURN; 
STOP;
DO K = 1 TO 11;
TO = 20; /* ASSIGNMENT STATEMENT*/

The following example shows how names can either establish an object to be operated on or denote part of a statement.

DECLARE X(5) FIXED; 
L: X(3) = 25;

Both X and L are identifiers, but DECLARE and FIXED are keywords. X is declared by a DECLARE statement; L is implicitly declared as a label.

A name consists of any combination of the following:

The following rules apply to names.

Examples:

STREET_NAME
@BETA
#Y7
C
$7

Names can be written using both uppercase and lowercase letters.

By default, all lowercase letters are interpreted as their uppercase equivalents. The -lowercase compiler option causes the reverse of this behavior. Refer to the Open PL/I User's Guide for more information on this option.

Because there are no reserved names in Open PL/I. Names that are used as keywords, 1such as READ or INTO, can also be identifiers. However, this practice makes programs difficult to read and should be avoided whenever possible.

Previous Topic Next topic Print topic