Symbolic operators

A variety of characters can be used as symbolic operators in CL commands.

The following characters are used as symbolic operators in CL commands.

Table 1. Symbolic operators in CL commands
Name Symbol Meanings
And & Symbolic logical operator for AND.
Asterisk * Multiplication operator. It indicates a generic name when it is the last character in the name. It indicates IBM i reserved values (predefined parameter values and expression operators) when it is the first character in a string.
Concatenation |>, |<, and || 3 Character string operator (indicates both values are to be joined).
Equal = Symbolic equal relational operator.
Greater than > Symbolic greater than relational operator.
Less than < Symbolic less than relational operator.
Minus (hyphen) - Subtraction operator, command continuation operator, and negative signed value indicator. Separates parts of date values. 1
Not ¬ 2 Symbolic NOT relational operator.
Or | 3 Symbolic logical operator for OR.
Plus + Addition operator, command continuation character, and positive signed value indicator.
Slash / Division operator. Separates parts of date values. 1 Used as the separator between parts of a qualified name.
Notes:
  1. Valid only when the job date separator value specifies the same character.
  2. In some character sets, including the multinational character set, the character ^ replaces the ¬ character. Either ^ or *NOT can be used as the logical NOT operator in those character sets.
  3. In some character sets, including the multinational character set, the character ! replaces the | character. Either ! or *OR can be used as the logical OR operator, and either || or *CAT can be used as the concatenation operator in those character sets.
Note: The symbolic operators can also be used in combinations.

Symbolic operators can also be used in the following ways.

Table 2. Symbolic operators: Other uses
Name Symbol Meanings
Ampersand & It identifies a CL variable name when it is the first character in the string.
Percent % It identifies a built-in system function when it is the first character in the string.
Question mark ? It specifies a prompt request when it precedes a command name or keyword name.