Hi SAS Community,
I am selecting data from a larger table based on two macro variables, var1 and var2. Both are numeric BEST12.
However, when I run the SQL code I am getting an empty dataset and I can't work out why. Any help would be really appreciated!
proc sql;
select distinct var1 into :v1 separated by "," from dataset1; %put &v1;
quit;
proc sql;
select distinct var2 into :v2 separated by "," from dataset1; %put &v2;
quit;
proc sql;
create table output1 as
select *
from dataset2
where var1 in (&v1) and var2 in (&v2);
quit;
I have checked, and in dataset2 the two variables are also BEST12. format. There is no error code, the file is just empty. I have also checked and instances of var1, var2 occur in both dataset1 and dataset2 so I do not know why it is not pulling data from dataset2 based on these two variables.
Example outputs of %put &v1 and %put &v2:
5,8,9,11,13,14,22,27,28,34,52,55,57,66
2.2007E8,2.2008E8,2.2009E8,2.2106E8,2.2111E8