Hello programmers,
I wanted to run an analysis taking into account complex sampling. Can anyone help me check my codes? They did not run. New to macros. It didn't give me any errors in the log.
%Macro Printit;
%surveygenmod(data=adult_asthma3, y=urg_tim,x=MDD mold age smoker income smoke_inside educate,
dist=binomial, link=logit, weight=LLcpwt_F, strata=_ststr, cluster=_psu, fpc=, scale=deviance, intercept=y,
vadjust=n);
run;
%MEND printit;
It may be as simple as you didn't actually have SAS run the macro ... this goes after the code you show
%printit
(Although there is no need of a %PRINTIT macro, you could just run %SURVEYGENMOD outside of the %PRINTIT macro)
Otherwise, if that's not it: A brief comment — saying the code doesn't run never gives us any useful information. Show us the log, with nothing chopped out. Click on the </> icon and paste the log, as text, into the window that appears.
For macros, you need to run the command OPTIONS MPRINT; before your run the macro.
It may be as simple as you didn't actually have SAS run the macro ... this goes after the code you show
%printit
(Although there is no need of a %PRINTIT macro, you could just run %SURVEYGENMOD outside of the %PRINTIT macro)
Otherwise, if that's not it: A brief comment — saying the code doesn't run never gives us any useful information. Show us the log, with nothing chopped out. Click on the </> icon and paste the log, as text, into the window that appears.
For macros, you need to run the command OPTIONS MPRINT; before your run the macro.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.