CASE provides multi-choice logic. A variable’s value is compared with a number of alternatives: the first true alternative is selected. After performing this action execution resumes with the statements following END CASE.
WHEN (DFHENTER) THEN;
Custf.Region = 1;
WHEN (DFHPA1 OR DFHPA2 OR DFHPA3 OR 'x');
Custf.region = 2;
Custf.region = 3;
1. CASE (field) must name one or more fields. Thus CASE; is invalid. The field name is enclosed in parentheses
2. WHEN (field [OR field]…) names a list of fields and/or constants. These must be compatible with the field named in the CASE statement.
3. WHEN requires a “;” to show the end of the WHEN statement. You can write THEN if you like, in which case Jazz can insert the “;” for you.
4. ELSE means “none of the above” and must be the last condition within the CASE/END CASE;
5. The actions may be one or several Jazz statements.
6. If CASE names more than one fields, then WHEN clauses may give corresponding values separated by commas, but may not use OR. Right-hand values may be omitted, in which case any value is valid for the corresponding field. For example
C.A = 1;
C.A = 2;
#484 W Anything accepted for omitted values
C.A = 3;
C.A = 4;