Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Within an expression or condition a set of operators can be used. These are as follows:

Operator

Description

(

Open bracket

)

Close bracket

+

Add

-

Subtract

/

Divide

*

Multiply

=

Compare equal

^=

Compare not equal. See Note:

<

Compare less than

<=

Compare less than or equal to

>

Compare greater than

>=

Compare greater than or equal to

*EQ

Compare equal

*NE

Compare not equal

*LT

Compare less than

*LE

Compare less than or equal to

*GT

Compare greater than

*GE

Compare greater than or equal to

AND

And

OR

Or

*AND

And

*OR

Or

Expression evaluation is left to right within brackets, so use brackets liberally whenever any doubt exists as to the order in which the expression will be evaluated.

...

Since all conditions and expressions specified under LANSA are "quoted strings" you should also read 14.1.6 Quotes and Quoted Strings.

Some examples of conditions and expressions are:

  • Condition RDML commands to execute only if field #A is less than 10:

...

              IF COND('#A < 10')

...

          or  IF COND('#A *LT 10')
  • Change field #A to contain the value 10:

              CHANGE   FIELD(#A)  TO(10)

...

           or CHANGE   #A  (10)

...

           or CHANGE   #A 10
  • Condition RDML commands to execute only if field #A is greater than the sum of field #B and 10.62 divided by 2:

...

              IF COND('#A < ((#B + 10.62) / 2)')

...

          or  IF ('#A < ((#B + 10.62) / 2)')

...

          or  IF '#A < ((#B + 10.62) / 2)'
  • Change field #A to contain the sum of field #B and 10.62 divided by 2:

...

              CHANGE   FIELD(#A)  TO('(#B + 10.62) / 2')

...

           or CHANGE   #A  ('(#B + 10.62) / 2')

...

           or CHANGE   #A '(#B + 10.62) / 2'
  • Request that a product number be input by the user until it can be found in the product master, then display full details of the product:

...

           GROUP_BY NAME(#PRODUCT) FIELDS(#PRODNO #DESC #PRICE

...

                                          #QOH #TAX)

...

           BEGIN_LOOP

...

           DOUNTIL    COND('#IO$STS = OK')

...

           REQUEST    FIELD(#PRODNO)

...

           FETCH      FIELDS(#PRODUCT) FROM_FILE(PROMST)

...

                      WITH_KEY(#PRODNO)

...

           ENDUNTIL

...

           DISPLAY    FIELDS(#PRODUCT)

...

           END_LOOP

Anchor
Note:
Note:

Note

Note: Due to translation table issues between IBM i and PC platforms (ASCII/EBCDIC), using 5250 terminals or 5250 emulation mode terminals users should be very careful when using the  ^= Compare not equal expression, which can be presented as ^= or ¢= or ¬= depending on the terminal/keyboard used during edit. Use the *NE expression instead.