2 7 1 Examples

LANSA for i

2.7.1 Examples

These examples illustrate the use of the range of values rule facility:

Example 1

Field being checked:

Name

Type

Len

Dec

POSTCD

A

4

 

 

 

Range of values:

 

From Value

To Value

Comments

 

Or

Or

'2000'

'3000'

'4000'

'2900'

'3900'

'4900'

Check post code is in NSW, VIC or QLD. Post code is alpha.

 

 

Example 2

Field being checked:

Name

Type

Len

Dec

POSTCD

S

4

0

 

 

Range of values:

 

From Value

To Value

Comments

 

Or

Or

2000

3000

4000

2900

3900

4900

Check post code is in NSW, VIC or QLD. Post code is numeric.

 

 

Example 3

Field being checked:

Name

Type

Len

Dec

AMOUNT

P

5

2

 

 

Range of values:

From Value

To Value

Comments

0.01

999.99

Check is AMOUNT positive.

 

 

Example 4

Field being checked:

Name

Type

Len

Dec

AMOUNT

P

5

2

 

 

Range of values:

From Value

To Value

Comments

-999.99

-0.01

Check is AMOUNT negative.

 

 

Example 5

Field being checked:

Name

Type

Len

Dec

PERIOD

A

2

 

 

 

Range of values:

From Value

To Value

Comments

*LASTPER

*NEXTPER

Check PERIOD using site defined system variables *LASTPER and *NEXTPER.