Hey all,
I tried importing excel file into SAS which has no variables declared and then i had renamed it into the variables and when i tried performing the following command to :
1. Prepare the dataset for input for a Discriminant analysis via SAS.
2. Generate the means and the variance-covariance matrix of the data for the genuine note(Genuine = 1 and Fake =2 indicator column in the dataset).
Dataset contains six variables measured on 100 genuine and 100 forged (counterfeit/fake).
proc import datafile = '/home/u49442084/sasuser.v94/Swiss Bank data as excel-2.xlsx'
out = SwissBank
dbms = xlsx
replace;
GETNAMES=NO;
run;
proc print data=SwissBank (rename=(a=length b=left c=right d=bottom e=top f=diag g=type));
run;
proc corr data=SwissBank cov;
Where type="1";
run;
when checking for genuine notes I got the following error:
You have not created a variable named TYPE in data set SwissBank, so when you run PROC CORR, SAS can't find it and writes an ERROR to the log.
Perhaps you mean this:
proc corr data=SwissBank (rename=(a=length b=left c=right d=bottom e=top f=diag g=type)) cov;
Still getting the same error, variable type here is a categorical datatype and if i am renaming it as type$ it throws an error there too. So i just had to convert it into CSV file and there it worked well
Thanks
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.