I'm using SAS University and i copied and pasted a program into a new program window, gave it a name etc. It's ready to run. I run just the import statement, it imports it fine. I run the data statement, it runs just fine. However, when i try to run the Proc Univariate statement, i get: "Variable GLDcm in list does not match type prescribed for this list." It's just a column of numbers in an excel file.
The same type of file, with the same type of columns of numbers, ran just fine in the other program, but now it won't run. However, if i convert GLDcm to logGLD using the logGLD=log(GLDcm); statement, then the Proc Univariate runs fine. I want to see if the untransformed data is normally distributed, so i don't want to do logGLD if it's not necessary.
1) Why won't SAS University recognize the column of data GLD_cm?
if that can't be resolved,
2) how can i un-transform the logGLD back into regular numbers so that SAS will read the data?
Here's the code as i have it now:
%web_drop_table(WORK.IMPORT);
FILENAME FILEREF '/folders/myfolders/TreeGrowth.xlsx';
PROC IMPORT DATAFILE=FILEREF
DBMS=XLSX
OUT=WORK.IMPORT;
GETNAMES=YES;
RUN;
data TreeGrowth;
set import;
if Hgt="Ht";
logGLD=log(GLDcm);
logDBH=log(DBHcm);
logHeight=log(Height);
run;
/*proc print data=TreeGrowth;
run;*/
proc univariate Normal Plot data=TreeGrowth;
var GLDcm logGLD;
Histogram GLDcm logGLD/Normal;
QQPLOT GLDcm logGLD;
output out=AllEvents;
run;
.........................................
Thanks for the help
If you are importing from Excel, sometimes a column of numbers (as seen by the human observer) is actually considered character, and thus not appropriate in PROC UNIVARIATE (one of the many drawbacks of using Excel files).
So you need to examine the output from PROC CONTENTS to see if this variable is character or numeric. Also, there are options in PROC IMPORT (if that's what you are using) that can force columns to be numeric.
@AaronJ wrote:
I'm using SAS University and i copied and pasted a program into a new program window, gave it a name etc. It's ready to run. I run just the import statement, it imports it fine. I run the data statement, it runs just fine. However, when i try to run the Proc Univariate statement, i get: "Variable GLDcm in list does not match type prescribed for this list." It's just a column of numbers in an excel file.
The same type of file, with the same type of columns of numbers, ran just fine in the other program, but now it won't run. However, if i convert GLDcm to logGLD using the logGLD=log(GLDcm); statement, then the Proc Univariate runs fine. I want to see if the untransformed data is normally distributed, so i don't want to do logGLD if it's not necessary.
1) Why won't SAS University recognize the column of data GLD_cm?
if that can't be resolved,
2) how can i un-transform the logGLD back into regular numbers so that SAS will read the data?
Here's the code as i have it now:
%web_drop_table(WORK.IMPORT);
FILENAME FILEREF '/folders/myfolders/TreeGrowth.xlsx';
PROC IMPORT DATAFILE=FILEREF
DBMS=XLSX
OUT=WORK.IMPORT;
GETNAMES=YES;
RUN;data TreeGrowth;
set import;
if Hgt="Ht";
logGLD=log(GLDcm);
logDBH=log(DBHcm);
logHeight=log(Height);
run;
/*proc print data=TreeGrowth;
run;*/proc univariate Normal Plot data=TreeGrowth;
var GLDcm logGLD;
Histogram GLDcm logGLD/Normal;
QQPLOT GLDcm logGLD;
output out=AllEvents;
run;.........................................
Thanks for the help
new_num = input(old_name, 8.);
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.
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.