CDL Accumulator Statements and the ADD or SUBTRACT Keywords

Unlike constraint statements, accumulator statements contain numeric expressions. In an accumulator statement, the ADD and TO keywords are required.

Example

You use ADD ... TO in an accumulator rule.

ADD a TO b;
ADD (a + b) * c TO d;

ADD ...TO with Decimal Operands and Option Classes or Collections

Plan carefully when writing rules with decimal operands and option classes, or collections. The following table explains what action should be taken when A accumulates to B and B is either an option class with multiple options, or B is a collection. The columns are If, AND, and Then.

If

AND

Then

A resolves to a decimal

Option 1 and Option 2 are both integers

Use the Round() function on A

A resolves to a decimal

Option 1 and Option 2 are both decimals

No further action is needed on A

A resolves to a decimal

Option 1 is decimal and Option 2 is integer

Use Round() function on A to meet the most limiting restriction - Option 2 an integer.

A is an integer

Option 1 and Option 2 are both integers

No further action is needed on A