Within an expression or condition a set of operators can be used. These are as follows:
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.
The liberal use of brackets is a good programming practice as well. It makes clear your intent to the RDML compiler, but also more importantly, to anyone maintaining the application in the future.
Expression components are checked for type and length compatibility. The syntax of the expression or condition is also checked to ensure that it is correct.
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
DOUNTIL COND('#IO$STS = OK')
FETCH FIELDS(#PRODUCT) FROM_FILE(PROMST)
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.