Data visualization with SAS programming

%newsurv

Reply
Occasional Contributor
Posts: 7

%newsurv

Hi Experts Smiley Happy

 

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.

Super User
Posts: 9,611

Re: %newsurv

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
SAS Super FREQ
Posts: 496

Re: %newsurv

Posted in reply to KurtBremser

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.

Occasional Contributor
Posts: 7

Re: %newsurv

Posted in reply to WarrenKuhfeld
I'm so sorry but macro is not working with vertical bar.
Occasional Contributor
Posts: 7

Re: %newsurv

Posted in reply to KurtBremser

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.

Attachment
SAS Super FREQ
Posts: 496

Re: %newsurv

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

Occasional Contributor
Posts: 7

Re: %newsurv

Posted in reply to WarrenKuhfeld

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.

 

 

SAS Super FREQ
Posts: 496

Re: %newsurv

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

Occasional Contributor
Posts: 7

Re: %newsurv

Posted in reply to WarrenKuhfeld

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.

SAS Super FREQ
Posts: 496

Re: %newsurv

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.

Occasional Contributor
Posts: 7

Re: %newsurv

Posted in reply to WarrenKuhfeld
oh.. I see.

Thank you so much for your help.

Have a nice day!
Ask a Question
Discussion stats
  • 10 replies
  • 252 views
  • 2 likes
  • 3 in conversation