Value Ranges
Information
- Value ranges are gathered for each data item in the Data Items module.
- As a result, you have to do the following for each data item:
- define a value range type in the VR type field, that specifies
- whether the gathered value range takes effect, and
- when the DI is calculated or checked.
- define a formula for the value range itself in the Value range field.
- define a value range type in the VR type field, that specifies
Note
- Value ranges can be deactivated without the formula being deleted. For this purpose, delete the entry in the VR type field.
Value Range Type
Information
- There are three groups of value range types. Data items can be
Standard Value Ranges
PL: Check by List
Objective
- To check whether the data field input coincides with the defined values
The value range
- is a tabular list of permissible values.
- consists of Operatoren and Operanden.
Details
- Numeric data items
- List of permitted input values separated by commas.
DI | name | VR type | Value Range | Explanation |
---|---|---|---|---|
000090 | Date deviation Start 1 | PL | 1,2,3,4,5,6,7,8 | Only the values specified can be entered. |
- Alphanumeric data items
- Specify the list of allowed input values in quotation marks and separated by commas.
DI | name | VR type | Value Range | Explanation |
---|---|---|---|---|
000162 | Class | PL | "A","B","C","D","E","X" | Only the values specified can be entered. |
Note
- When an incorrect input is made,
- the "Please check entry" message appears in the status line and
- the incorrect value will not be applied so that the previous value is displayed again.
- An entry is correct if it is an element of the value range.
PF: Check Using a Formula
Objective
- To check the data field input for values that result from the formulas
The value range
- is a check formula.
- consists of Operatoren, Operanden and possibly Functions.
Details
- A check formula must return the value 0 or 1, with:
- 0: FALSE
- 1: TRUE
- Only one formula can be specified for each DI.
- One formula may extend over several lines.
Example
DI | name | VR type | Value Range | Explanation |
---|---|---|---|---|
001019 | Requested SD | PF | (DI001019 <= DI001020) || (DI001020 0) | Requested SD must not contain a date which is greater than the date in Requested ED. |
001020 | Requested ED | PF | (DI001019 <= DI001020) || (DI001020 0) | Requested ED must not contain a date which is smaller than the date in Requested SD. |
Note
- When an incorrect input is made,
- the "Please check entry" message appears in the status line and
- the incorrect value will not be applied so that the previous value is displayed again.
- An entry is correct if the value range formula returns the TRUE value.
CO: Calculations
Objective
- To calculate the output value of a field in accordance with the prescribed formula.
The value range
- is a calculation formula.
- consists of Operatoren, Operanden and possibly Functions.
- Only one formula can be specified for each DI.
- One formula may extend over several lines.
Note
- For incorrectly constructed value ranges, the following error messages appear upon module start:
- VR: division by zero
- Attempt to divide a number by zero.
- VR: result of calculation invalid (storage volume)
- Result of the calculation exceeds the defined length of the virtual DI, e.g. when character chains are put together from constants or variables without the use of the TRIM() function.
- VR: Operanden type incompatible
- Attempt to execute a calculation between two different data types, e.g. a character string and a number. Convert relevant Operanden using the corresponding function, e.g. FMT(), ATOI().
- VR is invalid: DIxxxxxx
- Syntax error in the value range. Also follow-up message for the error messages executed above.
- VR: division by zero
- Depending on the specific error, an error message is only displayed once in each session when the value range is opened for the first time. Afterwards, the value range is not run any longer.
Construction Rule for the CO, PL, PF Value Ranges
Permissible Objects
Operators
- arithmetic: +, -, *, /, % (Modulo)
- logical:
- AND: &&
- OR: ||
- NOT: !
- binary:
- AND: &
- OR: |
- NOT: !
- Compare: <, =, >, <=, ==, >=, <>, != (means NOT)
- Quotation marks: „"
- Parentheses: ( )
Operands
- Data items: real, virtual
- Variables:
- Users: @U
- Dynamic: @D
- Global: @G
- System: @
- Program constant
- Fixed value: strings, numbers
data type
- Integer: 2 byte, 4 byte, mixed
- String: arbitrary number of characters (also matchcode*)
Rules
Rules for Operatoren
- Arithmetic, logical, binary and comparison operators can be separated by blank spaces between the Operanden. This has no functional significance, but helps making value ranges more readable.
- Quotation marks and parentheses must exactly enclose contents, i.e. blanks may only be included if they have a functional significance.
- If the Boolean value of a value range is to be inverted, i.e. FALSE is to be output instead of TRUE, the contents of the value range must appear in parentheses and the expression "!=1” must be appended.
Example
DI | name | VR type | Value Range | Explanation |
---|---|---|---|---|
005297 | KST to be loaded | EXIST(DI005297,808) | EXIST function to check for non-existent records. |
Details
- In value ranges, calculations can be performed using "modulo" (operator = %)
Example
DI | name | VR type | Value Range | Explanation |
---|---|---|---|---|
007585 | Time R | CL | HYEXIST3("006428") %86400 | DIxxxxx % DIyyyyyy = remainder of the division (e.g. 9 % 5 = 4) |
Rules for Operanden
- The operand value can be
- output directly (e.g. as part of a string) or
- simply serve as part of a calculation
Example
DI | name | VR type | Value Range | Explanation |
---|---|---|---|---|
003136 | HB element | CO | TRIM(@G100) + "\" + TRIM(@G106) + "\" + DI001825 + "\" + @191 + "\" + TRIM(@G103) + "\" + "M" + @191 + DI000123 + @G107 | Value is calculated and output |
Rules for input in value areas
- Data item: DI<DI-Identnummer>
- is always entered with the prefix DI.
- Variable: "@ <Variablenart> <Variablennummer>"
- are always specified in quotation marks. Superfluous blank characters at the end are automatically cut off.
Meaning | Variable number |
---|---|
System variable | @[ID] |
Dynamic variable | @D[ID] |
Global variable | @G[ID] |
User variable | @U[ID] |
- Constant: CONST <"constant ID">
- The constant ID is always specified in inverted commas. Superfluous blank characters are automatically cut off.
- Fixed value:
- Numbers must be specified without quotation marks if they are to be used in calculations. A number enclosed in quotation marks is interpreted as a string.
- Strings must be enclosed in quotation marks.
Note
- The Operanden variable and constant must be trimmed in the value range if you do not want the entire data field length to be output as source (for constants, e.g. a length of 70).
Example
- The value output is the same as the value input:
Python Value Ranges
PY: Check, Calculation, Change
Information
- With Python value range functions, the functions from the Python Api and default Python functions, data items can be checked, calculated and changed.