You are here: LANSA for i User Guide > 2. Fields > 2.8 List of Values Rule > 2.8.1 Examples

2.8.1 Examples

These examples are provided to illustrate the use of the list of values rule facility:

Example 1

Field being checked:

Name

Type

Len

Dec

STATE

A

3

 

 

List of values:

List Of Values

Comments

'NSW'

'QLD'

'VIC'

Check for valid Australian state mnemonic.

 

Example 2

Field being checked:

Name

Type

Len

Dec

NAME

A

7

 

 

List of values:  

List Of Values

Comments

*BLANKS

A blank name is an error. Reverse the default error logic to get ERROR if in list, NEXT if not in list.

 

Example 3

Field being checked:

Name

Type

Len

Dec

COMPNO

P

1

0

 

List of values:  

List Of Values

Comments

1

2

3

Company number must be 1, 2 or 3.

 

Example 4

Field being checked:

Name

Type

Len

Dec

YEAR

A

2

 

 

List of values:  

List Of Values

Comments

*LASTYEAR

*THISYEAR

*NEXTYEAR

Year must equal one of the site defined system variables *LASTYEAR, *THISYEAR or *NEXTYEAR