Zantan
in addition to the (always) sensible suggestions from Cynthia,
you can also invoke the
base SAS function COMPARE() within %sysfunc().
The benefit of compare() is that it has a parameters to indicate options like:
1 you wish it to be case insensitive,
2 ignore leading blanks
3 compare over the length of the shorter of the two strings, rather than the default longer
4 remove quotes from name-literals
and it will return the position within the strings of the first difference.
a better description than mine can be found in the documentation on the SAS web site at
http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/... .
so be frustrated more by our difficulty in finding appropriate search terms to find the solution to our problem - often our expectations are wrong because more issues than we anticipate have frustrated a simple search.
good luck
peterC