BookmarkSubscribeRSS Feed
lakshmishree
Fluorite | Level 6

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:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc corr data=SwissBank cov;
74 Where type="1";
ERROR: Variable type is not on file WORK.SWISSBANK.
75 run;
2 REPLIES 2
PaigeMiller
Diamond | Level 26

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;
--
Paige Miller
lakshmishree
Fluorite | Level 6

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

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
  • 2 replies
  • 399 views
  • 0 likes
  • 2 in conversation