Everything has worked well up until the point I tried to log my variable RINC. Then I get this error message: NOTE: Variable RINC is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
200 at 66:10
NOTE: There were 200 observations read from the data set WORK.PANELPROJ.
NOTE: The data set WORK.TWO has 200 observations and 9 variables.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds
Here's my full code. I hit my pathway.
ibname session1 "C:\x";
PROC IMPORT OUT = panelproj
DATAFILE = "C:\x"
DBMS=csv REPLACE;
run;
proc contents;
run;
proc print;
run;
data one;
set panelproj;
if year = 2004 then cpi = 188.9;
if year = 2008 then cpi = 215.303;
if year = 2012 then cpi = 229.594;
if year = 2016 then cpi = 240.007;
RINC = INC/(CPI/100);
run;
proc contents;
run;
proc print;
run;
proc means;
class year;
var RINC UR educ VT;
run;
data two;
set panelproj;
logRINC= log(RINC);
run;
proc print;
run;
My code when I try to log my variable is not turning blue which makes me think I'm writing the code wrong. This is the way I did it in SAS studio but it may be different for SAS 9.4.
RINC is defined in dataset one, not panelproj.
Not sure why your variables are turning blue. Perhaps they need medication?
You cannot take the LOG() of a variable that doesn't exist. You created RINC in the dataset ONE when you made it from PANELPROJ. Why not just add this new variable to that step also?
data one;
set panelproj;
if year = 2004 then cpi = 188.9;
if year = 2008 then cpi = 215.303;
if year = 2012 then cpi = 229.594;
if year = 2016 then cpi = 240.007;
RINC = INC/(CPI/100);
logRINC= log(RINC);
run;
Or if you want to make a new data set them make sure to read the right input dataset.
data two;
set one;
logRINC= log(RINC);
run;
I still have no idea what meant by a variable turning blue. And your response does not really clarify it either.
If one of the answers was helpful mark it as the correct answer.
Or if you solved it on your own then post the solution and mark your own answer as the solution.
PS Note that there was nothing condescending in my original post. I gave my diagnosis of what I thought was your problem and two ways to solve it.
@khalillx wrote:
Everything has worked well up until the point I tried to log my variable RINC. Then I get this error message: NOTE: Variable RINC is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
200 at 66:10
NOTE: There were 200 observations read from the data set WORK.PANELPROJ.
NOTE: The data set WORK.TWO has 200 observations and 9 variables.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds
Here's my full code. I hit my pathway.
ibname session1 "C:\x";
PROC IMPORT OUT = panelproj
DATAFILE = "C:\x"
DBMS=csv REPLACE;
run;proc contents;
run;
proc print;
run;
data one;
set panelproj;
if year = 2004 then cpi = 188.9;
if year = 2008 then cpi = 215.303;
if year = 2012 then cpi = 229.594;
if year = 2016 then cpi = 240.007;
RINC = INC/(CPI/100);
run;proc contents;
run;proc print;
run;
proc means;
class year;
var RINC UR educ VT;
run;
data two;
set panelproj;
logRINC= log(RINC);
run;
proc print;
run;
My code when I try to log my variable is not turning blue which makes me think I'm writing the code wrong. This is the way I did it in SAS studio but it may be different for SAS 9.4.
Foundation, Base or Display Manager, pick you choice for name, enhanced editor does not highlight function calls in general because most are not "keywords" like DATA, PROC or SET.
Look closely at this:
data two;
set panelproj;
logRINC= log(RINC);
run;
You created RINC in dataset one, not in dataset panelproj:
data one;
set panelproj;
if year = 2004 then cpi = 188.9;
if year = 2008 then cpi = 215.303;
if year = 2012 then cpi = 229.594;
if year = 2016 then cpi = 240.007;
RINC = INC/(CPI/100);
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.