It is generally a bad idea to "prequote" macro variables. The quotes belong to the SAS statement where the macro variable is used. For example:
%let amt = 5000;
title "Criteria: Amount GT &amt";
where amount gt &amt;
In the first instance, the quotes belong to the title statement. In the WHERE statement, if you had prequoted the value for &AMT, you probably would have generated an incorrect WHERE statement, because there's a difference between:
where amount gt 5000;
where amount gt '5000';
But let's say that your WHERE statement -did- need quotes...this is what you want to generate:
where name = "Alfred";
and your macro variable is named WANT...
You should create &WANT like this:
%let want = Alfred;
where name = "&want";
Or, here's another example of where you might need quotes for syntax purposes:
%let muppet = Kermit the Frog;
length character $20;
character = "&muppet";
While it might be tempting to prequote the value Kermit the Frog, the quotes actually belong to the assignment statement where the &MUPPET macro variable is being used and the usage context and quoting requirements are known.
Why did you have quotes when you assigned a value to &A??? How are you using that macro variable?
Thanks for the info.
The reason for masking the quotes is:
I'm trying to pass the worksheet name in the select select statement.
******I get all the wksheet names into tabnaes table.*******
connect to excel (path="&inpt.\Walgreens 2009 08.xls");
create table tabnaes as
select table_name from connection to excel (jet::tables);
delete from tabnaes where table_name like '%(2)%' or table_name like '%NAMES%';
select table_name into:wksht from tabnaes;
%put &wksht resolves to 'medmark novoseven 080109103600$'
When pass the wksht name, it should be without quotes as per syntax.
So I thought I can create a macro variable and then pass it without quotes as shown below.
If I dont create a macro variable, i will have to manually change the worksheet name everytime.(as shown in second select statement below)
To re-iterate what Cynthia is saying, why did you put the quotes on it in the first place? Macro variable assignments do not need quotes, so unless you want them to show up when you resolve the macro variable, just don't include them . Like this:
%let a=medmark novoseven 080109103600$;