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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.