BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aaronh
Quartz | Level 8

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

%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);

View solution in original post

7 REPLIES 7
Astounding
PROC Star

%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);
aaronh
Quartz | Level 8

Thanks Astounding!

 

Using the str( ) and a % sign before the unbalanced quotation mark solved my issue.

 

 

ballardw
Super User

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

aaronh
Quartz | Level 8
Thank you ballardw!
Tom
Super User Tom
Super User

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
Quartz | Level 8
Thanks for the input! I was using it in a data step where statement:

...
where place = "&place.";

Tom
Super User Tom
Super User

@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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2699 views
  • 4 likes
  • 4 in conversation