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.);
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.