2 7 Range of Values Rule

LANSA for i

2.7 Range of Values Rule

This display results when:

  • An existing range of values rule has been chosen for review.
  • A new range of values rule is to be added.

 

 DC@P700103               Range of Values Rule 

 

  File         : XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   

  Field        : XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   

                                                                       

 Order to process / source . . . 999 / DATA DICTIONARY                 

 User description of rule  . . . ______________________________        

 Use rule when performing  . . . ADD   CHG    DLT                      

 Check if field is in range : ________________to   _________________

                or in range : ________________to   _________________

                or in range : ________________to   _________________

                or in range : ________________to   _________________

                or in range : ________________to   _________________

                or in range : ________________to   _________________

                                                                       

 If      field is in range of values above                : NEXT       

 Else    field is NOT is range of values above            : ERROR      

 Specify error message number, file and library : ______  ______  ____

 Or text :  __________________________________________________________ 

 

 

 Fnn=Help  Fnn=Exit  Fnn=Cancel  Fnn=Messages                          

 

 

 

Note: The file name is only displayed when working at file level. Change and delete command keys are only enabled when displaying an existing check.

If an existing rule is being reviewed then the CHANGE key can be used to place the screen in change mode and the required changes made.

If an existing rule is being reviewed then the DELETE key can be used to delete the rule. Note that the delete is immediate. No confirmation is required.

If a new rule is being added then the screen will be presented initially with default values. Change as required and press Enter to complete specification of the rule.

Input Options

Order to Process

Mandatory, but always pre-filled to <highest order number + 10>. Rules are performed (and displayed) in the sequence of these order numbers (within the validation level). Order numbers must be unique within the validation level.

For instance these entries would be performed in the sequence RULE04, RULE01, RULE02, RULE05, RULE03:

Rule

Level

Order To Process

RULE01

Dictionary

100

RULE02

Dictionary

200

RULE03

File

20

RULE04

Dictionary

50

RULE05

File

10

 

 

Source

Output field. Indicates the source or level at which the rule applies.

User Description of Rule

Mandatory. Enter a brief description of the rule to aid other users in understanding its purpose.

Use Rule When Performing

At least one entry required. Pre-filled to ADD and CHG. Specifies "when" the rule is to be performed. Allowable values are:

ADD

When information is added (inserted) to the database.

ADDUSE

When information is added, and the field is actually specified/used in the INSERT command being executed.

CHG

When information is changed (updated) in the database.

CHGUSE

When information is changed, and the field is actually specified/used in the UPDATE command being executed.

DLT

When information is deleted (removed) from the database.

 

Most commonly used entries are ADD, CHG and CHGUSE. Use of DLT by itself is a common and a very powerful rule mechanism. If ADDUSE is specified, ensure that the default value of the field is a valid database value. Use caution when specifying CHGUSE with a rule that involves multiple fields, because the check will only be done when the field linked to the rule is specified on an UPDATE command, and not done when it is omitted, regardless of whether or not any of the other fields referenced in the rule are specified.

Check If Field Is in Range

At least one range is required. A maximum of 20 ranges can be specified (use roll keys to input). A "from" and "to" value is required for each range specified. Range values specified can be:

  • An alphanumeric literal (in quotes) such as 'STATUS', 'JONES'
  • A numeric literal such as 1, 14.23, -1.141217.
  • Another field name such as CUSTNO, INVNUM, etc.
  • A system variable name such as *BLANKS, *ZERO, *DATE or any other system variable defined at your installation.
  • A process parameter such as *UP01, *UP02, etc.

Range values are checked for type and length compatibility. System does NOT check "from" value is less than "to" value.

If Field Is in Range of Values Above

Mandatory. Pre-filled to NEXT. Specifies what is to happen if the field is found to be in one of the ranges specified. Allowable values are:

NEXT

Field is "okay". Proceed to next rule for this field.

ERROR

Field is in error. Issue error message described below.

ACCEPT

Field is okay. Bypass all other rules for this field.

 

Else Field Is NOT in Range of Values Above

Mandatory. Pre-filled to ERROR. Specifies what is to happen if the field is NOT found to be in one of the ranges specified. Allowable values are:

NEXT

Field is "okay". Proceed to next rule for this field.

ERROR

Field is in error. Issue error message described below.

ACCEPT

Field is okay. Bypass all other rules for this field.

 

Error Message Number, File and Library

Optional. Specify either error message number, file and library or error message text, (refer text) but not both. Error message files and error message numbers are a native part of the IBM i operating system. Refer to the IBM supplied Control Language Reference Manual for details. CL commands involving message files include CRTMSGF and ADDMSGD.

You can directly edit the message details from this screen. Enter as much of the message details as is known and use the function key labeled "Work Msgd" (Work Message Description). This will cause a WRKMSGD command to be executed, using as much of the supplied message details as is possible. This facility will allow you to create or edit the message details. Upon completion of the WRKMSGD command, this screen will be redisplayed, unchanged, to allow you to proceed.

Do not store user defined messages in, or modify "shipped" messages in, the LANSA message file DC@M01 via this or any other message file editing facility. It is regularly replaced by new version or PC (program change) installations.

Text

Optional. If you do not wish to use an error message file (refer to Error Message Number, File and Library) to store the message text, then you may enter the text of the error message to be displayed directly. If this facility is used then the message will have no second level text associated with it. Refer to Messages and the Help Key.

If neither an error message number, file and library nor error message text is specified LANSA will insert a default error message number, file and library as the error message. These default messages are "general purpose" and do not provide much detail about the specific cause of the error.