Is there any method,option or statement to ignore case sensitivity for variables.
example:
datasetA:
name
daniel
datasetB:
name
Daniel
if I compare using Proc Compare ,datasetA and datasetB, results showing as diferences in two datasets.
How to make proc compare case insensitive?
thanks in advance.
PROC COMPARE compares raw values. If you want a case-insensitive comparison, you can use the UPCASE function or the $UPCASE format to transform character data. You can either do this directly in the DATA step, or you can create data VIEWS that contain the upcase version of character data. For example:
/* create second data set with lowercase names */
data class2;
set sashelp.class;
Name = lowcase(Name);
run;
/* create data views with upcase names */
data BaseData / view=BaseData;
set sashelp.class;
NewName = upcase(Name);
run;
data CompareData / view=CompareData;
set class2;
NewName = upcase(Name);
run;
/* compare the upcase values */
proc compare base=BaseData compare=CompareData;
var NewName;
run;
I agree that this could be useful for analysts who processes English strings (in general, use the Roman alphabet). I seem to recall this request on the SAS Software ballot in the early 2000s. However, that was about the same time that SAS was going global. Many SAS customers process text in Japanese, Chinese, Korean, and other languages for which "uppercase" does not make sense. I'm not making excuses, and I don't have any knowldege about why there isn't a case-insensitive option, but I mention non-Latin languages as a possible reason why this feature was never added.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.