03-08-2014 07:50 AM
Having a SAS macro on your desktop is an unusual practice. I suggest you talk to whoever put it there and ask how you are expected to use it.
On the off chance that you put the macro there yourself, does the file end with the suffix ".sas"? If so, it is probably the source code for the macro and you can double click it to start SAS and run the macro code. This will compile the macro cade and if the source file also includes an invocation of the macro, it should run. The macro source will appear in your program editor, the compiled macro sits in a special catalog in your work library. Otherwise you can open the code from the SAS session editor and run it from there.
If this macro is compiled code you won't be able to use it until it is registered in your SAS session. The easiest way to do this is to run the uncompiled source code.
If none of this advice sfits your situation you need to tell us exactly what you have and why it is there.
03-08-2014 11:41 AM
Thank you for your advice. I downloaded the macro myself from http://www.mcw.edu/biostatistics/statisticalresources/CollaborativeSoftware.htm
I was following the instructions given in the paper by Zu Zhang , in which they provide a macro for making adjusted survival curves in SAS. In the paper, it is instructed that one should copy the macro in the current working SAS directory(which I cannot do, it might be simple thing but I cannot get it done).
Then they instruct to invoke the macro by the following commands:
%ADJSURV (inputdata, time, group, covariates, model, outdata);
Yes, the macro saved on my desktop has an extension .sas. I even tried to invoke it by putting the path as suggested on the internet, but it does not work.
03-08-2014 12:41 PM
The %include should have the full path to the file, regardless of where it is.
%include 'path to the file as you would in network directory';
You can also open the macro code in SAS and run it directly and then use the second line of code.
03-08-2014 02:49 PM
Are you using PC SAS or are you using Enterprise Guide with SAS executing on a different machine?
Either way why not just add the source code for the macro definition into the top of your program, right before the macro call.