CALL RXCHANGE Routine


Changes one or more substrings that match a pattern

Category: Character String Matching

Restriction: Use with the RXPARSE function

Syntax

CALL RXCHANGE ( rx,times,old-string < ,new-string >);

Arguments

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.

Details

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 .

Comparisons

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.

Example

See the RXPARSE function 'Examples' on page 811.

See Also

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




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net