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

I have a macro for propensity score as follow:

 

%macro prop_score (DatIn=, CatVar=, ConVar=, Outcome=, Event=, Iter=);

proc logistic data = &DatIn descending;
class &CatVar;
model &Outcome (event = "&Event") = &CatVar &ConVar /link=logit FIRTH Maxiter=&Iter ;
output out = ps_los pred = ps xbeta = logit_ps;
run;

%mend prop_score;

 

When I try to evoke the Macro with the following, it kept giving me ERROR 22-322: Expecting an integer constant at the MAXITER option but I did specify an integer?

 

%prop_score (DatIn = Dat,
                       CatVar = %Str( A B C D) ,
                       ConVar = E,
                       Outcome = F,
                       Event = D,
                       Iter=15000);

1 ACCEPTED SOLUTION

Accepted Solutions
CHELS
Obsidian | Level 7

Hi there!

 

Yes I am able to run it outside of the Macro. Actually I found the error~ I missed a comma (stupid error). Nevertheless, thank you for your help!

View solution in original post

3 REPLIES 3
tsap
Pyrite | Level 9
Its hard to tell without more information, but it looks to me like the error isn't being produced by the MAXITER option. It seems like the error would be from somewhere around the "&Event" and &CatVar area. Are you actually using these macro values (E, F,D, %Str( A B C D), etc), or is this just dummy data that you plugged in for the post? I ask mainly because from every proc logistic step I've seen, the 'event=' is typically populated with a '1' or '0', and not a letter character. Additionally, I only typically see the section that follows that to have one value to explain what the '1' or '0' stands for. Where based on your logic it stands for "%Str( A B C D)". If that makes sense. Have you successfully run the code outside of the macro statement with values hard coded prior to building it into the macro statement?
CHELS
Obsidian | Level 7

Hi there!

 

Yes I am able to run it outside of the Macro. Actually I found the error~ I missed a comma (stupid error). Nevertheless, thank you for your help!

Reeza
Super User
Please mark the question as solved to close this. In the future, please post your actual code and log, errors like that are easily found in the log.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2341 views
  • 1 like
  • 3 in conversation