A conditional expression specifies a condition the program must evaluate to determine the path of program flow.
1 – abbreviated
When you combine simple or negated simple conditions in a consecutive
sequence, you can abbreviate any of the relation conditions except
the first. You can do this by either:
1) Omitting the subject of the relation condition
2) Omitting both the subject and the relational operator of the
condition
A relation condition in the consecutive sequence must contain a
subject (or subject and relational operator) that is common with the
preceding relation condition. There must be no parentheses in the
consecutive sequence.
Format -
relation-condition { { AND } [NOT] [relational-operator] object } ...
{ { OR } }
2 – class
The class condition tests whether the contents of an operand are
numeric or alphabetic. It also determines if an alphabetic operand
contains only uppercase or only lowercase characters or if the
operand is a class-name.
Format -
{ NUMERIC }
identifier-1 IS [ NOT ] { ALPHABETIC }
{ ALPHABETIC-LOWER }
{ ALPHABETIC-UPPER }
{ class-name }
2.1 – identifier-1
Identifier-1 must reference a data item whose usage is explicitly or implicitly DISPLAY. If identifier-1 is a function-identifier, it must reference an alphanumeric function.
2.2 – class-name
is the user-defined word for a class. It always possesses the global attribute
3 – combined_and_negated_combined
A combined condition results from connecting conditions with one of
the logical operators AND or OR.
Format -
condition { { AND } condition } ...
{ { OR } }
condition
can be
1) A simple condition
2) A negated simple condition
3) A combined condition
4) A negated combined condition
5) Valid combinations of the preceding conditions
4 – condition-name
The condition-name condition determines if a data item contains a value assigned to one of that item's condition-names. The term conditional variable refers to the data item. Condition-name refers to a level 88 entry associated with that item. Format - condition-name
5 – database_key_condition
Database conditions allow alternate paths of control depending on the
truth value of a test involving conditions peculiar to the database
environment. The database conditions are the tenancy, member, and
database key conditions.
The database key condition determines whether: (1) two database key
values identify the same database record, (2) a database key value
is null, or (3) a database key value is identical to any database
key value in a keeplist.
Format -
{ ALSO database-key }
database-key IS [ NOT ] { NULL }
{ WITHIN keeplist-name }
database-key
references a currency indicator or a keeplist entry in the
Sub-Schema Section.
6 – member_database_condition
Database conditions allow alternate paths of control depending on the truth value of a test involving conditions peculiar to the database environment. The database conditions are the tenancy, member, and database key conditions. The member condition determines whether member records are present in one or more sets. Only member record types defined in the Sub-Schema Section are considered in determining the truth value of the condition. Format - [ set-name IS ] [ NOT ] EMPTY set-name is a subschema set name.
7 – negated_simple
The logical operator NOT negates a simple condition. The truth value of a negated simple condition is the opposite of the simple condition's truth value. Thus, the truth value of a negated simple condition is true only if the simple condition's truth value is false. It is false only if the simple condition's truth value is true. Format - NOT simple-condition
8 – relation
A relation condition states a relation between two operands. The
program compares the operands to determine whether the stated
relation is true or false. The first operand is called the
condition's subject. The second operand is called its object.
Either operand can be: (1) an identifier, (2) a literal, or (3) the
value of an arithmetic expression. The set of words that specifies
the type of comparison is called the relational operator.
Format -
{IS [NOT] GREATER THAN }
{IS [NOT] > }
{IS [NOT] LESS THAN }
{identifier-1 } {IS [NOT] < } {identifier-2 }
{literal-1 } {IS [NOT] EQUAL TO } {literal-2 }
{arith-express-1} {IS [NOT] = } {arith-express-2}
{IS GREATER THAN OR EQUAL TO}
{IS >= }
{IS LESS THAN OR EQUAL TO }
{IS <= }
9 – sign
The sign condition determines if the algebraic value of an arithmetic
expression is less than, greater than, or equal to zero.
Format -
{ POSITIVE }
arithmetic-expression IS [ NOT ] { NEGATIVE }
{ ZERO }
10 – success-failure
This condition tests the return status codes of COBOL and non-COBOL
procedures for success or failure conditions.
Format -
status-code-id IS { SUCCESS }
{ FAILURE }
status-code-id
must be a word or longword COMP integer as represented by
PIC S9(1 to 9) COMP.
11 – switch-status
The switch-status condition tests the "on" or "off" setting of an external logical program switch. Format - condition-name
12 – tenancy_database_condition
Database conditions allow alternate paths of control depending on the
truth value of a test involving conditions peculiar to the database
environment. The database conditions are the tenancy, member, and
database key conditions.
The tenancy conditions determine whether a record in the database is
an owner, or member, or a tenant in one or more sets.
Format -
{ OWNER }
[ NOT ] [ set-name ] { MEMBER }
{ TENANT }
set-name is a subschema set name.