Previous Topic Next topic Print topic


Punctuation

In Open PL/I, punctuation symbols are either operators or separators.

Operators define the arithmetic or comparative operations to be performed on expressions in a statement. The table below lists the Open PL/I operators.

Symbol       Meaning
+ Addition or the plus prefix
- Subtraction or the minus prefix
* Multiplication
** Exponentiation
/ Division
^ or ~ Logical NOT
| or ! Logical OR
& Logical AND
> Greater than
< Less than
= Equal to
^> or –> Not greater than
^< or –< Not less than
^= or ~= Not equal to
>= Greater than or equal to
<= Less than or equal to
|| or !! String concatenation
–> Pointer resolution

Separators delimit and separate identifiers, keywords, and constants in statements. The table below lists the Open PL/I separators.

Symbol
Meaning
 ( ) Encloses lists, defines order of expression evaluation, separates names of statements and options from specific keywords
 , (comma) Separates subscripts and procedure arguments, separates identifiers in a structure name, and precedes the BY NAME option
 ' (single quote)     Delimits bit strings and character strings
 . (period) Specifies a decimal point. Connects elements of a qualified name
 : Terminates a procedure name or a statement label
 ; Delimits statements

Names and constants may be separated from one another by one or more blanks, or tabs, rather than by separators. Additional blanks surrounding punctuation symbols are optional. In the following examples, blanks are represented by boxes (Blank representation).

Examples of blank usage

The first statement requires no blanks because each name is separated from the next by a punctuation symbol. The second statement shows the optional use of extra blanks. The third statement shows optional blanks surrounding the equal symbol (=) and after the semicolon, the remaining blanks being required blanks.

Note that when an arithmetic constant is followed by a name, at least one blank or punctuation symbol is required to separate the arithmetic constant from the name.

Previous Topic Next topic Print topic