I tend to use a lot of dynamic (explicit) sql in poc sql. Something like this dynamic WHERE CLAUSE works fine : WHERE TableAlias.ColumnName IN (%bquote('&MacroVariable.')) However for some reason, this snippet of a SQL query: SELECT &MacroVariableContainingColumnName. FROM ... does not work. I get the error message: Table does not contain MacroVariableContainingColumnName So the actual content of (e.g. Column1) is not used. Just to clarify, I want to generate the dynamic SQL: select C1 from something along those lines: %let MacroVariableContainingColumnName = C1;
using
proc sql;
connect to TERADATA (OVERRIDE_RESP_LEN=YES SERVER=DBC AUTHDOMAIN="Bla" MODE=TERADATA);
create table X.Y as
Select *
from connection to teradata
(
SELECT &MacroVariableContainingColumnName.
... Any ideas?
... View more