BookmarkSubscribeRSS Feed
Shazan
Calcite | Level 5

Hello!

I have imported an excel spreadsheet with multiple variables, one of which is not in numeric data. I know that's the interpretation of the error code I'm receiving. 

 ERROR: Variable ENGINE in list does not match type prescribed for this list.



I first attempted to edit the data in excel file I uploaded and re-uploaded it into SAS Uni, but no changes to the variable format were made. I did some googling and found a video for SAS but it is not working in SAS University edition...can anyone help

4 REPLIES 4
Reeza
Super User
data want;
set have;
engine_num = input(engine, 8.);
run;

proc means data=want;
var engine_num;
run;

If you have any characters in that field, ie engine = '4 cyl' then that will not work as 4 cyl is not a number, you'll first need to remove the character portion. I'll assume above is your case though since you have not indicated otherwise.

Shazan
Calcite | Level 5

Thanks for your quick response! I have three types of engines listed: traditional, advanced, aerodiv
I figure a simple 1,2,3 would work as replacements through excel, but again that didn't work.

I just tried what you suggested, and I'm no longer getting the error message, but I'm getting blanks/zeros for the engine related data.

ballardw
Super User

Proc Univariate expects to analyze numeric values.

If you have categories like traditional, advanced, aerodiv then statistics like: mean, maximum, minimum, median, standard deviation and such cannot be calculated.

 

So those variables would be looked at with Proc Freq to get counts or if comparing based on other variables one of the procedures designed for some form of categorical analysis.

 

What sort of values were you expecting Proc Univariate to give you?

Reeza
Super User

Well, in that case you're recoding data to 1/2/3 but what does an average of 1.4 tell you in that case? I'd argue that's useless information and you should summarize it using PROC FREQ. You never actually indicated what code generated the error so I have no idea what you're trying to do overall, just assuming things. 

 

proc freq data=have;
table engine;
run;

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1228 views
  • 0 likes
  • 3 in conversation