option nonotes noquotelenmax;
%dev_prod(, %nrstr(%easybird), macro);
option notes quotelenmax;
Don't I already have this though? Sorry if I'm not understanding.
No, the problem is likely inside the definition of your macro %Dev_Prod.
It looks like it uses CALL EXECUTE to call your macro %EasyBird.
Yes you quoted it with %NRSTR(), but inside your macro %Dev_Prod it's possible something unquoted it.
Can you post the definition of the %Dev_Prod macro?
Your current macro is generating:
MPRINT(DEV_PROD): call execute ("%send_email");
You want it to generate something like:
MPRINT(DEV_PROD): call execute ('%nrstr(%send_email)');
Note single quotes, and %NRSTR().
This was exactly the issue. The %dev_prod macro determines if a script is being run on our dev server or our prod server and treats it accordingly (like the dev server doesn't have an email application). I thought they were identical environments, but taking out that macro resolves my issues. I'll have to take that up with the DW architect but for now I'm gtg.
Thank you so much for your help, everyone. Much appreciated.
Jennifer
Looks like you have over complicated your setup. A few pointers.
Try to make the difference between DEV/PROD be something that is handled by just changing the running environment. Setting macro variables, changing LIBNAME and FILENAME statements. etc. Then the actual user code does not need to worry about such things. So something like:
%dev_prod(environment=prod);
%easybird;
If you need to pass the name of a macro then pass it as plain text so that the system that is using it can decide to use the name as the name of a macro (or a file or macro variable or dataset or variable etc.).
%dev_prod(environment=dev,name=easybird,type=macro);
Consider using regular SAS code to do your code generation instead of macro code. Instead of writing a macro create a program and %INCLUDE the program. Instead of use macro logic to generate code use data step logic to write code to a file and %INCLUDE the generated file. Instead of using CALL EXECUTE() use PUT to write the code to a file and %INCLUDE the file.
Maxim 3: Know Your data. Inspect the dataset from which your macro variable is created, if it ever has more than 0 observations for the conditions you specify. Since you create easybird before the macro is invoked, you should see the number of observations in the log.
There are ten observations in the data set easybird! There are more than zero observations 99% of the days it runs.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.