BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mitreto
Fluorite | Level 6

Dear colleagues,

 

I'm running proc compare on two data sets.

Code before that makes sure the variable names are the same. One of the variable is not recognised as having the same name.

I ended up naming it "X" just because you cannot really be wrong with one letter.

 

The procedure still shows "X" to be in file1 but not in file2 and  "X" to be in file2 but not in file1. Interesting bit is that when I select the variable name in the editor it highlights both names, so the editor confirms that the text is the same.

 

Would you be able to advise any plan of action? 

 

thank you

 

Kind regards

 

Marin

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

I'm just spitballing here, but I can only think that although your columns look like they have the same name, they are different.

 

Can you try something like this:

 

proc sql;
	create table Vars as select Name from dictionary.columns where libname="SASHELP" and memname="CLASS";
quit;

data Translate;
set Vars;
HexRep = put(Name, $hex64.);
run;

Do this for both input datasets, and see if there's any difference in the hexadecimal representation of the name. I'm wondering if you've maybe got an internationalization problem.

 

Tom

 

View solution in original post

4 REPLIES 4
Reeza
Super User
Can you show your code and log?
Mitreto
Fluorite | Level 6

Hi Reeza,

 

Unfortunately it is  clients code so I wont be able to share it.

The procedure works for all other variables and for another 2 datasets I'm comparing next to these two.

 

I'll check with the client if I'll be able to share the code / results.

 

thank you

 

Kind regards

 

Marin

TomKari
Onyx | Level 15

I'm just spitballing here, but I can only think that although your columns look like they have the same name, they are different.

 

Can you try something like this:

 

proc sql;
	create table Vars as select Name from dictionary.columns where libname="SASHELP" and memname="CLASS";
quit;

data Translate;
set Vars;
HexRep = put(Name, $hex64.);
run;

Do this for both input datasets, and see if there's any difference in the hexadecimal representation of the name. I'm wondering if you've maybe got an internationalization problem.

 

Tom

 

Mitreto
Fluorite | Level 6

Hi Tom,

 

thank you very much for the advice. The hex format revealed a character that funnily was picked up within the editor [appending itself at the end of the variable name].

 

I have cleared all and now everything is fine.

 

Thank you 

 

Marin

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1639 views
  • 1 like
  • 3 in conversation