bdfs1m1jStructured Programming Macros

SELECT Macro Group

Use this macro group to control the choice among a number of different code paths by a logical comparison. The SELECT macro group is similar to the CASE macro group except that instead of using an arithmetic expression to select an alternative clause, SELECT conditions are successively evaluated until an alternative can be selected.

The SELECT macro group includes the following macros:

Format




SELECT
specifies the start of the SELECT structure.

WHEN
specifies the start of a selection.

operand1
is a symbol, a register enclosed in parentheses, or a literal that can be used as the first operand on a compare or test under mask (TM) instruction.

operand2
is a symbol or a register enclosed in parentheses that can be used as the second operand on a compare or test under mask (TM) instruction.

operator
is one of the following relational operators:
Operator
Description
 EQ 
Equal
 = 
Equal
 NE 
Not equal
 ¬= 
Not equal
 LE 
Less than or equal
 <= 
Less than or equal
 LT 
Less than
 < 
Less than
 GE 
Greater than or equal
 >= 
Greater than or equal
 GT 
Greater than
 > 
Greater than
 Z 
Zeroes (or OFF)
 O 
Ones (or ON)
 M 
Mixed zeros and ones
 NZ 
Not zeros
 NO 
Not ones
 NM 
Not mixed.

OR
allows additional expressions to be evaluated on one WHEN statement.

|
allows additional expressions to be evaluated on one WHEN statement.

code1
is the code to process when the associated WHEN statement is true.

OTHERW
specifies the start of the code to process when all the previous WHEN statements are false.

code2
is the code to process when the previous WHEN statements are false.

ENDSEL
ends the SELECT structure.

Entry Requirements

None.

Return Conditions

Programming Considerations

Examples

The following is an example of a SELECT macro group.

         SELECT
            WHEN  EBW000,EQ,OPTION1
            :
*   Code to process
            :
            WHEN  EBW000,EQ,OPTION2,OR,EBW000,EQ,OPTION3
            :
*   Code to process
            :
            OTHERW
            :
*   Code to process
            :
         ENDSEL
 

Related Macros