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

Hello SAS community!

 

I ran into an error that I cannot solve. 

I am trying to run proc phreg within a macro. The portion of the code is presented below...

_MooMoo_0-1589492821955.png

For some reason, I am having a following error message. 

_MooMoo_1-1589493014898.png

Any advises are welcome! Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @_MooMoo,

 

semicolon.png

Correct the definition of macro variable ADJ_STRAT. Apparently, it contains a semicolon, which ends the MODEL statement so that "/rl ..." appears as the beginning of a new, of course invalid statement.

View solution in original post

6 REPLIES 6
ballardw
Super User

What is the R1 option supposed to do? I don't find that as an option on the model statement in the documentation.

 

If you borrow options from other procedures they don't always exist in others or may need other steps to accomplish similar tasks.

 

 

_MooMoo
Obsidian | Level 7
It is RL option used in PROC PHREG. It adds confidence interval to the output.
Reeza
Super User
Test your code outside of a macro first, with hardcoded values. If you get the same error then your issue is with code not your macro logic or variable resolution. Otherwise the issue is your macro logic.
_MooMoo
Obsidian | Level 7
Thanks for your suggestion. I did test outside of a macro and it worked. It is bizarre that it only does not work when it is inside of the macro...
FreelanceReinh
Jade | Level 19

Hello @_MooMoo,

 

semicolon.png

Correct the definition of macro variable ADJ_STRAT. Apparently, it contains a semicolon, which ends the MODEL statement so that "/rl ..." appears as the beginning of a new, of course invalid statement.

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
  • 6 replies
  • 2058 views
  • 2 likes
  • 4 in conversation