BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChuksManuel
Pyrite | Level 9

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;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1173 views
  • 2 likes
  • 2 in conversation