In these fields, you can specify calculation formulas for variables defined for the current format in the window Specification of Input Data Formats. The number refers to the variable with the corresponding number in the window Specification of Input Data Formats - variable 1 = variable 1, variable 2 = variable 2, and so on.
The variable operation is carried out each time the current record is written to the file. In the table part of this window, you can specify further variable operations that should be carried out for each field in the current record when the record is written to the file. The variable operations in the table part are performed before the variable operations in the card part.
As an example of a calculation, you can increase the variable for a customer payment record that specifies the total number of records by one. If you have specified in the window Specification of Input Data Formats that variable 3 is of the type “Integer,” you can write the following in front of line no. 3 in this island
#VARIABLE.3 + 1
The result is that variable 3 is assigned the value of variable 3 plus one.
If variable 5 has been specified as being of the type “Amount Field,” you can write the following in front of line no. 5 in this island:
#VARIABLE.5 + #INPUTDATALINE.AMOUNTCURRENCY
The result is that variable 5 is assigned the value of variable 5 plus the amount from the current customer payment record. This way, the total customer payment is summarized.
You can also refer to the special variable #VARIABLE.0, which contains the value currently read from the customer payment file.
In “Appendix D: Reference Fields in Format Specifications” in the Reference Manual you can find a list of all elements that you can refer to.
You can use the following operators in the expressions:
+ | - | > | < | = | >= | <= | <> | * | / | %
On a Macintosh, you can also write >=, <= and <> as follows:
Š | ð | ¦
The operator / indicates division and returns a real value, also when dividing two integers. The operator % returns a percentage – #VARIABLE3 % VARIABLE4 thus shows variable 3 less variable 4, divided by variable 4 and multiplied by 100. If variable 4 is 0, the result will also be 0.
|