Changes one or more substrings that match a pattern
Category: Character String Matching
Restriction: Use with the RXPARSE function
CALL RXCHANGE ( rx,times,old-string < ,new-string >);
rx
specifies a numeric value that is returned from the RXPARSE function.
Tip: The value of rx points to an expression that is parsed by RXPARSE. CALL RXCHANGE uses the expression to find and change a matching substring.
times
is a numeric value that specifies the maximum number of times to change matching substrings.
Restriction: Maximum value of times is 2,147,483,647.
old-string
specifies the character expression to be searched and changed as a result of the change operation.
new-string
is a character variable that contains the result of the change operation.
If old-string is a character variable, new-string is optional. If new-string is omitted, old-string is changed in place.
If old-string is an expression that is not a character variable, you must specify new-string .
The regular expression (RX) functions and CALL routines work together to manipulate strings that match patterns. Use the RXPARSE function to parse a pattern you specify. Use the RXMATCH function and the CALL RXCHANGE and CALL RXSUBSTR routines to match or modify your data. Use the CALL RXFREE routine to free allocated space.
See the RXPARSE function 'Examples' on page 811.
Functions and CALL routines:
'CALL RXFREE Routine' on page 387
'CALL RXSUBSTR Routine' on page 388
'RXMATCH Function' on page 799
'RXPARSE Function' on page 800