Description of the IF statements


IF ... ENDIF statements define a block of script statements that are executed conditionally. IF sets the condition with subsequent dependent scripts statements that are executed if the condition is true. An ELSE statement defines the block of script statements for execution if the condition is false.

An IF statement compares one string to another. These strings can be literals or variables. An operator dictates the type of comparison to be performed. The following operators are valid:

  • EQ
  • =
  • NE
  • ¬=
  • GT
  • >
  • GE
  • >=
  • LT
  • <
  • LE
  • <=
  • IN

Any of these operators can be preceded by NOT. The NOT symbol (^ for PC keyboards; ¬ for IBM terminal keyboards) has the hex value X'5F'.

The IN operator allows a list of comparative string values to be entered. The operators must be specified within parentheses. These values are compared to determine whether a true condition or a false condition exists.

If the result of IF comparison is true, processing continues with the statements dependent upon the IF ... ENDIF block. The ELSE statement is optional. Use the ELSE statement to specify processing statements if the condition is false. An ENDIF statement must be used to identify the end of the IF processing block.

Related topic



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*