Hey, i'm having trouble referring to variables in excel
PROC UNIVARIATE DATA=SGH;
Var Number_of_pulls_vacuum;
Run;
The error statement is:
The title of the variable in excel and SAS is Number of pulls vacuum
What am i doing wrong?
@u41125093 wrote:
What am i doing wrong?
<snark> You're using Excel </snark>
Frankly, what happens is that you have strings in your Excel header line that do not meet the conditions for valid SAS names.
Valid SAS names have a maximum length of 32, contain only letters, digits or underlines, and do not start with a digit.
Since SAS 8 or so, non-standard names can be used with a so-called name literal: "some nonstandard name"n
This only works if
options validvarname=any;
is set.
So you have several avenues:
What does the output of
Proc contents data=sgh;
run;
look like?
Or show the code you are using to connect to Excel.
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.