I am struggling the most simple SAS macro code. for some reason I cannot get this the call the variable income no matter what I try (quotes, removing underscore, etc.). here is my code. thanks for your help.
options symbolgen mprint;
data temp;
infile DATALINES dsd missover;
input count income_error;
CARDS;
1, 1,
1, 0,
1, 0,
;
run;
%macro one(pc);
proc means noprint data= temp;
var count &pc_error;
output out= &pc1
sum(count &pc_error) =
;
run;
%mend;
%one(income);
you have missed '.' to represent the macro variable to correctly. use the below code.
%macro one(pc);
proc means noprint data= temp;
var count &pc._error;
output out= &pc.1
sum(count &pc._error) =
;
run;
%mend;
%one(income);
you have missed '.' to represent the macro variable to correctly. use the below code.
%macro one(pc);
proc means noprint data= temp;
var count &pc._error;
output out= &pc.1
sum(count &pc._error) =
;
run;
%mend;
%one(income);
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.