Arithmetic operations perform addition, subtraction, multiplication, and division. A simple arithmetic operation involves one operation; a compound arithmetic operation involves two or more operations.
When a compound arithmetic operation is specified on a process parameter, CA Culprit breaks down the compound operation into a series of simple arithmetic operations. Each of these system-generated statements is printed on the Input Parameter Listing, as shown on the following page. CA Culprit uses the following criteria to resolve compound arithmetic operations into simple arithmetic operations:
When a compound expression is resolved into multiple simple arithmetic operations, intermediate results are stored in internal work fields. These internal work fields are defined and maintained by CA Culprit. The following figure illustrates the internal work-field names CA Culprit uses in these operations.
When fields with a varying number of decimal positions are involved in arithmetic operations, intermediate results are computed to the precision of the field containing the most decimal positions. When the ROUND option is in effect (see ROUND later in this chapter), intermediate results are computed to two extra decimal positions for additional accuracy. After the number of decimal positions is determined for internal result fields, the simple arithmetic operations generated by the COMPUTE statement are performed.
Only the result field value changes in an arithmetic operation. The values of the left and right operands remain unchanged, unless one of these fields is also the result field.
Input Parameter Listing of a Compound Arithmetic Operation:
mm/dd/yy INPUT PARAMETER LISTING Vnn.n PAGE 2 ******** PROCESS USER INTERNAL LABEL SEQUENCE PROCESS STATEMENT ******** 01 8 010 1 $ COMPUTE (SALARY + COUNT) X COUNT - INDX RESULT ◄──── User input 01 8 2 SALARY + COUNT WORK*01 ─┐ 01 8 3 WORK*01 X COUNT WORK*01 ├── CA-Culprit's interpretation of 01 8 4 WORK*01 - INDX RESULT ─┘ the compound arithmetic expression
Note: Compound arithmetic operations appear as simple arithmetic statements on the Input Parameter Listing. Internal work fields (WORK*01) store intermediate results.
|
Copyright © 2014 CA.
All rights reserved.
|
|