I am doing a Macro to deal with datas for an analysis.
And i have two doubts albout dealing with erros, like the data is not avalible, and others
1) It is possible to create a Macro(functrion) that is write in another program that is is the same process flow. How to doi it?
2) if the first option it is true, if we have any better doing this.
T
If you create a program that contains a macro, there are two different ways (maybe more, actually) to use it inside another program. Let's say you have created a macro named %MYMACRO and stored the code for this macro as c:\myfolder\mymacro.sas
Method 1: in your other program, use: %include "c:\myfolder\mymacro.sas";
Method 2: in your other program, use: options sasautos=(sasautos "c:\myfolder");
In either case, %MYMACRO will now run your macro in the other program
Hello PaigeMiler,
Thanks for the answer, but i had a problem doing the first option.
I exported the programa to C:\Users\f8118809\Documents.
And came this option:
WARNING: Physical file does not exist, /opt/sas94config_anl03/Lev1/SASApp_ANL03/C:\Users\f8118809\Documents\producao.sas.
ERROR: Cannot open %INCLUDE file C:\Users\f8118809\Documents\producao.sas.
You have given SAS the wrong folder name and/or the wrong file name where the SAS program with the macro is located.
Looks like you're using a server. You need to have the server path for the file, not your local path.
@ph10 wrote:
Hello PaigeMiler,
Thanks for the answer, but i had a problem doing the first option.
I exported the programa to C:\Users\f8118809\Documents.
And came this option:
WARNING: Physical file does not exist, /opt/sas94config_anl03/Lev1/SASApp_ANL03/C:\Users\f8118809\Documents\producao.sas.
ERROR: Cannot open %INCLUDE file C:\Users\f8118809\Documents\producao.sas.
Reeza,
Thanks now it is working.
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!
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.
Ready to level-up your skills? Choose your own adventure.