Hello,
I have a macro, in which there are a few %let statements like this:
%macro example(x,y);
%if &x. = city %then %do;
%let place = %bquote(Children's Hospital);
%end;
...
%mend example;
During macro compilation, it produces a note:
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space... is recommended.
Is there a way to amend this? I thought the %bquote( ) function is supposed to mask the quotation mark. Thank you!
%BQUOTE does mask, but it has its effect as the macro executes. It has no effect when the macro is compiled. You should be able to switch to:
%let place = %str(Children%'s Hospital);
%BQUOTE does mask, but it has its effect as the macro executes. It has no effect when the macro is compiled. You should be able to switch to:
%let place = %str(Children%'s Hospital);
Thanks Astounding!
Using the str( ) and a % sign before the unbalanced quotation mark solved my issue.
@aaronh wrote:
Hello,
I have a macro, in which there are a few %let statements like this:
%macro example(x,y); %if &x. = city %then %do; %let place = %bquote(Children's Hospital); %end; ... %mend example;
During macro compilation, it produces a note:
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space... is recommended.
Is there a way to amend this? I thought the %bquote( ) function is supposed to mask the quotation mark. Thank you!
NOT an error. That note occurs in almost any instance of a quote and other character that is not inside a masked string. Special constructs of dates, '01Jan2019'd, times, '13:15:25't, datetime, '01Jan2019:13:15:25'dt tell SAS to treat these as special values. Name literals such as 'Not a standard/SAS var'n uses the n to indicate a special variable name literal such as when addressing external database systems that all variable names that do not meet SAS name requirements. The note indicates that possibly at some point in the system your use might be interpreted differently.
How are you using the macro variable PLACE ?
Perhaps you can just add real quotes to the value instead of trying to use macro quoting.
%let place = "Children's Hospital";
....
data ...
location = &place ;
...
title1 "Report for " &place ;
@aaronh wrote:
Thanks for the input! I was using it in a data step where statement:
...
where place = "&place.";
Exactly.
So if PLACE already has the quotes built in then change that to:
where place = &place;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.