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

Hi everyone!

 

I am trying to run a decision-curve analysis on a macro and attached you will find the code I have used thus far. I continue to get the warning "Apparent invocation of macro DCA not resolved." I am pretty new to using SAS and I am sure there is a decently simple fix to this, however I am not sure where to go or what to do from here. Any help would be much appreciated. Thank you!Screen Shot 2018-11-21 at 9.59.37 AM.pngScreen Shot 2018-11-21 at 10.00.03 AM.png

1 ACCEPTED SOLUTION

Accepted Solutions
SuzanneDorinski
Lapis Lazuli | Level 10

Is the Decision Curve Analysis tutorial from Memorial Sloan Kettering Cancer Center?  

 

If so, the dca.sas program, which has the code for the dca macro, is in the "Download SAS Code" zip file.  From your screen shot, it looks like you have the files from the last zip file mentioned on that page, which does not include the files for the dca macro or the stdca macro.

 

View solution in original post

11 REPLIES 11
Tom
Super User Tom
Super User

You need to compile the macro before you call it.

 

You could include the definition in your program. Or use the %INCLUDE statement to source the definition from a file.

 

It looks like you might be trying to use an autocall library since you added HOME to your SASAUTOS option setting. 

 

For that to work the definition for the macro DCA needs to be in a file named 'dca.sas' that is stored in one of the folders or folders pointed to by a filerefs that are listed in SASAUTOS option.

 

Since you are running on Unix the filename needs to be in all lowercase.

 

 

Astounding
PROC Star

The problem lies in your LIBNAME statement (sort of).

 

To access SAS data sets in the folder, the LIBNAME statement is correct.  However, to access macros via the SASAUTOS option, you would also need a FILENAME statement pointing to the same folder.

 

LIBNAME for SAS data, FILENAME for text files (which includes macro definitions).

Tom
Super User Tom
Super User

Good point about needing a fileref instead of a libref in the SASAUTOS option.

 

Note that if you are really using HOME as a libref you also just use the PATHNAME() function to help you use its path in the SASAUTOS setting.

 

libname home ..... ;
options sasautos = ("%sysfunc(pathname(home))" sasautos);

What order to but your directory in relation to the the SAS supplied macros is determined by whether you want to be able to override the SAS supplied macros with your own definitions or not.

ryanpelletier
Fluorite | Level 6

Thank you all for your help so far-these have been great suggestions. Unfortunately, I have tried them out and still seem to be getting the same warning message. I think the problem may be in the way I have my folders set up/files saved to my Mac. Here is a screenshot inclusive of my files. This decisioncurveanalysis folder is from a tutorial on how to perform DCA in SAS, Stata, and R so that's why you will see those files there as well. Hopefully this information will help with resolving this issue. Thank you again!Screen Shot 2018-11-22 at 10.28.09 AM.png 

Tom
Super User Tom
Super User

You need to find the code that defines the macro.  It should look like:

%macro dca
 ....
%mend;

And run that code BEFORE you try to call the macro using the code in your photograph.

 

ryanpelletier
Fluorite | Level 6

Thank you! I think I am making progress...I no longer receive the "invocation of macro..." warning, however I am still receiving this error. Is there a problem with my code for this? 

 

Screen Shot 2018-11-22 at 1.46.43 PM.png

ryanpelletier
Fluorite | Level 6

Hi Tom, 

 

I do think this is what the issue is ( defining the DCA macro). The following screenshot is directly from the DCA tutorial code...would this be the code defining the macro? 

 

Screen Shot 2018-11-23 at 10.23.43 AM.png

Tom
Super User Tom
Super User

That is just another example of calling the macro. You need to check the setup instructions in the tutorial to see how they want you to install the actual macro definition.  Or search the other code files.

 

PS The photos of your program are really cute, but if you want to share code it is best to share it as text. Make sure to use the Insert SAS code icon to get a pop-up to paste in the text of your code.

SuzanneDorinski
Lapis Lazuli | Level 10

Is the Decision Curve Analysis tutorial from Memorial Sloan Kettering Cancer Center?  

 

If so, the dca.sas program, which has the code for the dca macro, is in the "Download SAS Code" zip file.  From your screen shot, it looks like you have the files from the last zip file mentioned on that page, which does not include the files for the dca macro or the stdca macro.

 

ryanpelletier
Fluorite | Level 6

This is exactly where the tutorial is from! Thank you for the heads up, I found the files and it is now running smoothly. Thank you for your help!

saslove
Quartz | Level 8

Remove the line -  %dca (data=dca,outcome=cancer....................)

 

You are already running the model using Proc Logistic. The macro %dca is only calling the model with outcome and predictors which are already defined in proc logistic.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 35219 views
  • 3 likes
  • 5 in conversation