Reputation: 530
In SAS I have a simple proc SQL statement in which I will control table to get data from by a predefined variable.
I want to keep the 'Data sorurce' and 'Initial Catalog' catalog fixed and define it in my proc sql but I want to declare the table beforehand.
In my code below I want to predefine where the '*' are
proc sql;
...
select ...
From *
...
quit;
I have tried the following wothout luck:
%let sqltable = "[my_table]";
proc sql;
...
select ...
From &sqltable.
...
quit;
Upvotes: 0
Views: 58
Reputation: 7769
Unless absolutely necessary, don't quote your macro variables; if you need quotes, quote them when you resolve them. In this case, you don't need quotes at all.
%let sqltable = [my_table]; proc sql; ... select ... From &sqltable. ... quit;
Upvotes: 3