BookmarkSubscribeRSS Feed
_maldini_
Barite | Level 11

I am using SAS University Edition.

 

I am receiving this error while using the PROC UNIVARIATE procedure. Other posts on this forum, and on other sites, refer to this error in the context of importing data. There is a suggestion that this error results when the data types are different. Both of these variables are numeric.

 

The procedure runs without error when only 1 variable is in the VAR statement.

 

Code: 

PROC UNIVARIATE;

VAR var1 var2;
RUN;

 

Error: 

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

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

 

Thanks for your assistance.

 

 

2 REPLIES 2
Reeza
Super User

Proc univariate requires numeric variables. Run a proc contents on your dataset to see your variable types. You don't have a DATA= portion in your proc? It's not required, but I'd highly insist on it, so you can trace your code. 

 

proc contents data=have;
run;

proc univariate data=have;
var var1 var2;
run;
_maldini_
Barite | Level 11

Thanks for the assistance.

 

Somehow these variable have been "typed" as character data. Yikes. I'm not sure how this happened.

 

Any suggestions for changing the type?

 

Btw, I will heed your recommendation on specifying the dataset.

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 2406 views
  • 2 likes
  • 2 in conversation