You are here: LANSA for i User Guide > 3. Files > 3.15 Virtual Fields > 3 15 6 Mathematical Calculation of a Field

3.15.6 Mathematical Calculation of a Field

This screen is displayed when the option to perform a Mathematical calculation for a virtual field has been chosen from the Virtual field extended definition action box.

 

 

 DC@P201607         Mathematical calculation of a field                

                                                                       

 File : XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX        (XXXX )

                                                                       

 Virtual field : XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   

                                                                       

 Derive "virtual" field on input from file . . .  ___ YES, NO          

                                                                       

   C A L C U L A T I O N    S P E C I F I C A T I O N                  

    Value 1     Operation  Value 2        Result                       

    __________      _      __________     __________                   

    __________      _      __________     __________                   

    __________      _      __________     __________                   

    __________      _      __________     __________                   

    __________      _      __________     __________           

 

 

 Fnn=Help  Fnn=Exit  Fnn=Cancel  Fnn=Messages  Fnn=Change  Fnn=Delete  

                                                                       

 

 

Working from the Mathematical calculation of a field screen you can:

Input Options

File

Is the name of the physical file currently being worked with.

Virtual Field

Is the name of the "virtual" field within the physical file currently being worked with. The value of the "virtual" field will be the result of the mathematical calculation of the fields specified in the "calculation specification" list. The "virtual" field must be a numeric data type, either packed or signed. The "virtual" field must be large enough to contain the result of the mathematical calculation otherwise unpredictable results could occur.

Derive "Virtual" Field on Input From File

Specifies whether the "virtual" field should be derived from the file on input. Valid entries are "YES" or "NO".

Value 1

Specifies the name of a field ("real" or "virtual" field name within this file), a valid numeric literal or an *WORKnnnnn field. This is an optional entry for all operation codes, except for when the operation code of "S" is specified, in this case the "Value 1" field must be blank. If a field name has been specified its data type must be either packed or signed.

By entering a '?' the single field selection screen is displayed. The selection list will be built from all the real and virtual fields in the current file's definition. Refer to 3.10.1 Select Fields When Working from File Definition Menu for more details.

Operation

Specifies the operation to be performed for the calculation line. Valid entries are:

"+"

Add

"-"

Subtract

"/"

Divide

"*"

Multiply

"S"

Set

Note: If the operation for a calculation line is '/' (Divide) a check will be automatically performed to ensure "Divide by zero" errors are prevented.

If the value within "Value 2" is 0 the "Result" value will be automatically set to 0, if the value within "Value 2" is not 0 then the '/' (Divide) operation will be performed.

Value 2

Specifies the name of a field ("real" or "virtual" field name within this file), a valid numeric literal or an *WORKnnnnn field. This is a mandatory entry for all operation codes, except for when the operation code of "S" is specified, in this case the "Value 2" is optional. If the operation code is "S" and "Value 2" is blank the system will automatically set "Value 2" to 0. If a field name has been specified its data type must be either packed or signed.

By entering a '?' the single field selection screen is displayed. The selection list will be built from all the real and virtual fields in the current file's definition. Refer to 3.10.1 Select Fields When Working from File Definition Menu for more details.

Result

Specifies the name of the "virtual" field or a *WORKnnnnn field. This is a mandatory entry.

Note: