Decide on multiple fields

Hello,

Is it possible to use decide on statement on multiple fields? Is it possible to code something like :

DECIDE ON [ EVERY|FIRST ] VALUE OF FIELD1 AND FIELD2
VALUES FIELD1 = 'X' AND|OR FIELD2 = 'Y' ....
.
.
.
NONE ...
END-DECIDE

I am not sure if I make it any clear.

Thanks.

Hi,
Well, perhaps DECIDE FOR EVERY/FIRST CONDITION
would help you in such a condition? :slight_smile:
Something like

decide for first condition
when field1 = ‘X’ and/or field2 = ‘Y’
perform do-XY

 when...

end-decide

Sorry if I didn’t get your problem properly.

Yes, “decide for” will solve the problem. So will “decide on inside decide on”. But, I wanted to know whether I can use “decide for” like “and/or” syntax in “decide on”.

Sorry for my English.

Thanks.

Well, it does NOT look so according to the syntax/explanation:

Function
The DECIDE ON statement is used to specify multiple actions to be performed depending on the value (or values) contained in a variable.
(a variable means “one variable” as far as I can tell).

You could probably do some tricky programming using REDEFINE so that you could decide on one variable that actually contains tha value of two variables, but I don’t really see the point. A DECIDE FOR would be a lot clearer to somebody else who would read your source code.

Just my 2 cents :slight_smile:

Ronald