BookmarkSubscribeRSS Feed
AMARC
Fluorite | Level 6

Hi Experts 🙂

 

I wanted to run SAS macro which is called "%newsurv"

 

(http://www.sascommunity.org/wiki/Kaplan-Meier_Survival_Plotting_Macro_%25NEWSURV)

 

however, it doesn't work on my SAS.

 

my sas version is 3.4 for windows 10 64bit.

 

so I think it is technically qualified to run this macro.

 

In the log, % command has a problem with the warning message.

and "ERROR 180-322"

 

So please tell me how to work out this problem...

 

Shoud I need any other command before %newsurv ??

 

thank you.

11 REPLIES 11
Kurt_Bremser
Super User

Please post your whole log of the failed step. Just the ERROR message itself does not reveal anything. Use the {i} icon for posting log text, so that horizontal spacing is preserved.

WarrenKuhfeld
Ammonite | Level 13

I tried submitting the latest macro.  Then I tried submitting the data and lead in code.  Finally, I submitted the example macro call.  Since I don't actually know what you did, it is hard to say what went wrong for you, but clearly that vertical bar does not belong before the macro call.  See if something like that helps.

 

| %newsurv(data=bmt, time=ftime, cens=STATUS, cen_vl=0,ev_vl=1,
    method=cif,class=diagnosis,height=4in,
    summary=0, risklist=0 to 2500 by 500, risklocation=BOTTOM,
    xmin=0, xmax=2500, xincrement=500,risklabellocation=left,
    timelist=250 500, timedx=Days,parheader=);

 Also be aware that SAS/STAT provides an entire chapter on customizing the Kaplan-Meier plot.

AMARC
Fluorite | Level 6
I'm so sorry but macro is not working with vertical bar.
AMARC
Fluorite | Level 6

This is what I'm done.

 

 I just follow the macro process in the website, but I don't know why it isn't working yet.

 

thank you so much for your attention.

WarrenKuhfeld
Ammonite | Level 13

That was my point.  The web site has a vertical bar.  It is incorrect.  The code will never work with it.

AMARC
Fluorite | Level 6

Thank you so much for your answer.

 

But the thing is even if I eliminated a vertical bar, it doesn't work yet.

 

Here's my log message.

 

--------------------------------------------------------------------------------------------------- 

WARNING: Apparent invocation of macro NEWSURV not resolved.
80   %newsurv(data=bmt, time=ftime, cens=STATUS, cen_vl=0,ev_vl=1,
     -
     180
ERROR 180-322: Statement is not valid or it is used out of proper order.

81       method=cif,class=diagnosis,height=4in,
82       summary=0, risklist=0 to 2500 by 500, risklocation=BOTTOM,
83       xmin=0, xmax=2500, xincrement=500,risklabellocation=left,
84       timelist=250 500, timedx=Days,parheader=);

--------------------------------------------------------------------------------------------------- 

 

It would be much appreciated if you could give me a help one more time.

 

thank you.

 

 

WarrenKuhfeld
Ammonite | Level 13

Have you submitted the code that defines the macro first?  I am guessing that you have not.

AMARC
Fluorite | Level 6

oh... I didn't do that.

 

Could tell me how to do this?

 

Because I'm rockie in the SAS field. 

 

 I really appreciate you taking the time.

WarrenKuhfeld
Ammonite | Level 13

The macro code was provided in that web page you cited.  When I tried it after your first post, it worked after I deleted that incorrect vertical bar.

AMARC
Fluorite | Level 6
oh.. I see.

Thank you so much for your help.

Have a nice day!
sms1891
Quartz | Level 8

Can you please clarify how do I run the macro code provided? I would like to use the %newsurv for my data set. I am getting the same error. Can you please help me out.

 

Thanks,

Satish

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 11 replies
  • 2888 views
  • 8 likes
  • 4 in conversation