The documentation from version 39.5.17 of PLANTA project can be found in the new PLANTA Online Help.

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.

Note

  • Value ranges can be deactivated without the formula being deleted. For this purpose, delete the entry in the VR type field.

Value Range Types

Information
  • There are three groups of value range types: Data items can be
    • checked as entry fields upon input (PL, PF)
    • calculated as output fields (Cx)
    • checked, calculated, and changed with Python (PY)

Standard value Ranges

PL: Check by list

Objective

  • To check the data field input for correlations with the defined values

The value range

  • illustrates a tabular listing of the permissible values.
  • consists of Operators and Operands.

Details

  • Numerical 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.
  • Alphanumerical 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.

Notes

  • When an incorrect input is made,
    • the "Please check entry" message appears in the status line and
    • the incorrect value is not 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

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 greater than the date in Requested ED.
001020 Requested ED PF (DI001019 <= DI001020) ||(DI001020 == 0) Requested SD must not contain a date smaller than the date in Requested ED.

Notes

  • When an incorrect input is made,
    • the "Please check entry" message appears in the status line and
    • the incorrect value is not 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 operators, operands and possibly functions.
  • Only one formula can be specified for each DI.
  • One formula may extend over several lines.

Notes

  • 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: Operands are type incompatible
      • Attempt to execute a calculation between two different data types, e.g. a character string and a number. * Convert relevant Operands 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.
  • 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: !
  • Comparisons: <, , >, <, =, >, <>, = (Means NOT)
  • Quotation marks: „"
  • Parentheses: ( )

Operands

  • Data items: real, virtual
  • Variables:
    • User: @U
    • Dynamic: @D
    • Global: @G
    • System: @
  • Program constant
  • Fixed value: strings, numbers

Data types

  • Integer: 2 byte, 4 byte, mixed
  • String: arbitrary number of characters (also matchcode*)
Rules

Rules for operators

  • Arithmetic, logical, binary and comparison operators can be separated by blank spaces between the operands. 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 with check for non existing records

Details In value ranges, calculations can be performed using "modulo" (represented by %)

Example

DI Name VR type Value range Explanation
007585 Time R CL HYEXIST3("006428") %86400 DIxxxxx % DIyyyyyy = Rest of the division (e.g. 9 % 5 = 4)

Rules for operators

  • 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 ID>
    • is always entered with the prefix DI.
  • Variable: „@ <Variable type > <Variable number >"
    • 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 operands 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

  • Value output is the same as the value input:

Python Value Ranges

PY: Check, calculation, change

Information

         PLANTA project









 
  • Suche in Topic-Namen

  • Suche in Topic-Inhalten
This site is powered by the TWiki collaboration platform Powered by Perl