I suspect I have hidden character '0A'X, 'M' in the variable. When I sort and put id on this variable, SAS thinks the same value(to me) are different. How to find out and change this hidden characters? The program I run is
proc sort data = meds_new2
out = meds_new3;
by All_Managers;
run;
data meds_new4;
set meds_new3;
by All_Managers;
if first.All_Managers then count + 1;
run;
and the output I got is:
thank you for your help.
I suspect I have hidden character '0A'X, 'M' in the variable. When I sort and put id on this variable, SAS thinks the same value(to me) are different. How to find out and change this hidden characters? The program I run is
proc sort data = meds_new2
out = meds_new3;
by All_Managers;
run;
data meds_new4;
set meds_new3;
by All_Managers;
if first.All_Managers then count + 1;
run;
and the output I got is:
thank you for your help.
If you know what the hidden character is, getting rid of it is easy:
all_managers = compress(all_managers, '0A'x);
If you don't know what the hidden character is you can find it with:
data temp;
set have;
all_managers = compress(all_managers, , 'ad');
run;
proc freq data=temp;
tables all_managers;
format all_managers $hex30.;
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.