How do I use a DEC Statement?

Decrement of a variable or attribute’s value. It subtracts one (the default) or more from the value of the variable or attribute.

Syntax

DEC name [, expression]

name This is the name of the variable or attribute to be decremented.

[expression] You can optionally decrement the variable or attribute by more than one using an expression which can be a constant or a mathematical expression. The name and expression must be separated by a comma. (The square brackets illustrate only that this element is optional.)

Example

The following are several easy-to-understand examples. The first decrements the value of v_ Var1 by one. The second decrements the value of a_ Attr1 by five. The third decrements the value of Number_in_System by the value of an attribute called a_ Batch_Size.

1) DEC v_Var1
2) DEC a_Attr1, 5
3) DEC Number_in_System, a_Batch_Size

Combining the DEC statement with the INC statement allows visualizing work in process (WIP) in a model, an area of a model, or a queue. For example, a hospital might want to track the number of people in the waiting room to visualize waiting volumes when changing model operations.

Ploting a variable captured with the INC and DEC statements.
Using the INC and DEC statements combined to track the number of people in the waiting are of the ER.
Using the DEC and INC statement combined to track the quantity of people in the waiting room.

Logic Statements:

Was this article helpful?

Related Articles

Go to Top