Previous Topic: VALIDATE FunctionNext Topic: CONVERTX Function


CONVERT Function

Use the CONVERT function to convert a pattern mask into its internal format. You can also use the CONVERT function to improve the performance of later MATCH function calls. Internal format pattern masks can be directly compared to determine which is more specific. CONVERT can replace a COMPARE function call.

A return code of zero indicates that the function successfully converted the pattern. The 44-character internal format replaces the original pattern mask when the return code is zero. A 24-character error message accompanies nonzero return codes.

DEF PM_FUNC            (X 8) =  ' ' 'FUNCTION'
DEF PM_PAT1           (X 88) =  ' ' 'PATTERN MASK1'
DEF PM_MSG            (X 24) =  ' ' 'ERROR MESSAGE'

SET PM_FUNC = 'CONVERT'
SET PM_PAT1 = 'SYS#.DDA####.-'
CALL CTSEPM USING PM_FUNC
                  PM_PAT1
                  PM_MSG