Hello
I'm trying to run this code but I'm getting the ERROR: variable .......... not found. Please help Frequency in SAS Studio.
CODE
proc freq data=dta ;
table transfusion trans_2gr ;
run;
LOG
The message seems very clear. Those two variables do not exist in your dataset.
Did you check the variable list?
Are you trying to use the variable LABEL instead of the variable NAME in your code?
Is it possible you have somehow accidentally created a variable name with a space in the middle of it? If so then to reference it you need to use a name literal.
table 'transfusion trans_2gr'n ;
Run a PROC CONTENTS on your dta data set to see the variable names and labels side by side.
proc contents data=dta; run;
@kamonpan wrote:
Hello
I'm trying to run this code but I'm getting the ERROR: variable .......... not found. Please help Frequency in SAS Studio.
CODE
proc freq data=dta ;
table transfusion trans_2gr ;
run;
LOG
67 proc freq data=dta ;68 table transfusion trans_2gr ;ERROR: Variable TRANSFUSION not found.ERROR: Variable TRANS_2GR not found.69 run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.