O'Reilly logo

SAS Functions by Example, Second Edition, 2nd Edition by Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functions That Compare Strings (Exact and "Fuzzy" Comparisons)

Functions in this section enable you to compare strings that are exactly alike (similar except for case) or close (not exact matches). Programmers find this latter group of functions useful in matching names that may be spelled differently in separate files.

Function:   COMPARE

Purpose:    To compare two character strings. When used with one or more modifiers, this function can ignore case, remove leading blanks, truncate the longer string to the length of the shorter string, and strip quotation marks from SAS n-literals. While all of these tasks can be accomplished with a variety of SAS functions, use of the COMPARE function can simplify character comparisons.

Syntax:      COMPARE( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required