Hi, I'm actually having a problem with a macro variable in a Proc SQL statement. Here's my code for the creation of the variable and the SQL statement. I'll use fictive data, but the essential is there. The problem is when I try to recall the variable in the where clause on the second SQL statement.
I get a whole lot of
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.
edit 1:
But it puts an red x like an error, and my people won't allow to run a program which generates an "error" though it isn't counted as one
Proc SQL noprint;
Connect to oracle ();
Select distinct data into: macro_var separated by " ',' "
from connection to oracle
(select data
from table1
where ( maturitydate > today
)
);
quit;
%put %nrbquote(')¯o_var%nrbquote(');
So here my var outputs 'asdgsd','asdsgsg','affdg'
proc sql;
Connect to oracle();
Create table Ind as
Select *
From connection to oracle
(
Select *
From table2
Where (data in (%nrbquote(')¯o_var%nrbquote(')))
);
Quit;
Thank you !