bdfs1m1bStructured Programming Macros

CASE Macro Group

Use this macro group to select between several alternatives without using complex If-Then-Else logic. This macro group is used when the choice between a number of different code paths can be controlled by an arithmetic variable.

The CASE macro group includes the following macros:

Format




CASE
starts a group of subcases based on an arithmetic expression.

If the arithmetic expression resolves to 0, the first subcase is processed; if the arithmetic expression resolves to 1, the second subcase is processed, and so on. There is no default subcase.

arithval
is a number represented directly in numeric form or in symbolic form. This value can be one of the following:

arithop
is one of the following arithmetic operators:
Operator
Description
 + 
Addition
 - 
Subtraction
 * 
Multiplication
 / 
Integer division
 // 
Remainder.

SCASE
specifies the start of a subcase.

code1
is the code to process for the associated subcase.

ENDSC
specifies the end of a subcase.

ENDC
specifies the end of the group of subcases.

Entry Requirements

None.

Return Conditions

Programming Considerations

Examples

Related Macros