BookmarkSubscribeRSS Feed
Doug
Calcite | Level 5

I am comparing two datasets where the following values exist on the same records in both:

^S={font_face=Symbol}£^S={}0.25

I visually inspected the values and even copied them to EXCEL (EXCEL says they are equal)...I also used the STRIP function to remove any leading or trailing blanks. Any ideas as to why SAS says they are not equal?

4 REPLIES 4
Amir
PROC Star

Hi,

Does one of the columns have a format applied to it, perhaps?

What do you get if you submit the following?:

data have1;

  a='^S={font_face=Symbol}£^S={}0.25';

run;

data have2;

  a='^S={font_face=Symbol}£^S={}0.25';

run;

proc compare base   =have1

             compare=have2;

run;

The above shows no difference on SAS 9.1.3 on PC and Mainframe.

Regards,

Amir.

Doug
Calcite | Level 5

These come out the same. I think it was due to the word "symbol" having a capital letter in one instance and not in the other.

MumSquared
Calcite | Level 5

If you do not care about case then you can use upcase() to convert the text to all be upper case when you strip out the spaces.

I often use upcase(compress(variable)) when manually coding text matching, compress removes the spaces within the text too.

Watch out for spelling mistakes when comparing text this way - I have seen 5 different ways of spelling coffee!

ballardw
Super User

Five ways to spell coffee is nothing, I had some survey data where IBM was spelled 18 ways. The most creative was I>B>M> .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1916 views
  • 0 likes
  • 4 in conversation