Previous Topic: Compare a Variable and a StringNext Topic: Compare Screen Data with a String


Use Substring Notation to Compare a Variable and a String

You can also use substring notation in variable/string comparisons. For example, the following is a statement that uses substring notation to determine whether the three characters beginning at position 1 of a user ID are "DEV":

COMPARE '&USERID(1,3)','DEV'

The statement says to begin with the first character position in the user ID and compare the first three characters with the target string "DEV."