BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Obsidian | Level 7
option nonotes noquotelenmax;
%dev_prod(, %nrstr(%easybird), macro);
option notes quotelenmax;

Don't I already have this though? Sorry if I'm not understanding. 

Super User

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().

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page:
Obsidian | Level 7

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. 



Super User Tom
Super User

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:


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.).


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.

Super User
Yup, CALL EXECUTE would make this program significantly simpler and easier to debug and manage.
Super User

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.

Obsidian | Level 7

There are ten observations in the data set easybird! There are more than zero observations 99% of the days it runs. 


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 21 replies
  • 5 in conversation