The OPSLIKE function lets you use wildcard characters to simplify coding text strings in OPS/REXX or AOF rules.
This function has the following format:
var = OPSLIKE(wildcard string, target string, [wildcard character string])
Contains the wild card characters.
Contains the resulting string that is being tested.
Contains an optional argument to specify the character designated to match any number of characters (default='*') followed by one or more characters that are designated to match any single character value (default='?').
Default: '*?'
The possible condition codes returned by the OPSLIKE function follow:
True, a match is found.
False, a match is not found.
Note: When the target string is matched and the remaining pattern string contains only wild card characters and blanks, then a match condition, or 1, is returned.
Examples: OPSLIKE Statement
var=OPSLIKE('XOOOO','OPSLOGOOOOOOOOOOOOOO','*?')
var=OPSLIKE('XOOOO','OPSLOGOOOOOOOOOOOOOO')
var=OPSLIKE('XYZ?ABC*','XYZ$ABCDEFG')
var=OPSLIKE('*XYZ?ABC','123XYZ+ABC')
var=OPSLIKE('*XYZ','XYZ1234')
var=OPSLIKE('*XYZ*','XYZ1234')
Note: The following two syntax error messages in the function call statement will cause an OPS/REXX error and terminate the program:
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |