Previous Topic: MATCH FunctionNext Topic: VALIDATE Function


COMPARE Function

COMPARE

Use the COMPARE function to compare two pattern masks and determine which is more specific. You can use this function to arrange a group of pattern masks in an order that allows your program to find the best-fit pattern mask. Higher return codes indicate an error. A 24 character error message accompanies nonzero return codes. A message that matches the PM_MORE, PM_LESS, or PM_SAME values accompanies a zero return code.

DEF PM_FUNC            (X 8) =  ' ' 'FUNCTION'
DEF PM_PAT1           (X 88) =  ' ' 'PATTERN MASK1
DEF PM_PAT2           (X 88) =  ' ' 'PATTERN MASK2'
DEF PM_MSG            (X 24) =  ' ' 'ERROR MESSAGE'
DEF PM_MORE           (X 24) =  'MORE SPECIFIC           '
DEF PM_LESS           (X 24) =  'LESS SPECIFIC           '
DEF PM_SAME           (X 24) =  'SAME SPECIFIC           '
SET PM_FUNC = 'COMPARE'
SET PM_PAT1 = 'SYS#.DDA####.-'
SET PM_PAT2 = 'SYS#.-'
CALL CTSEPM USING PM_FUNC
                  PM_PAT1
                  PM_PAT2
                  PM_MSG
IF PM_MSG = PM_LESS
   SET FLG = 'Y'
ENDIF