The problem goes like this:
I want to read the values of a variable in a table in SQL Database and each of this value should be given as an input to a SAS Macro which generate sas dataset according to the values given to the Macros, e.g., like if AE is the first value of the table, it should b read from database and give as the input to the Macro. This should b run for every value of the column in the database table.
I use the following code:
%let tbl=;
%macro DATASET;
%let n=1;
%do n %to &ds;
proc sql noprint;
select datasetname format=$10. into :tbl
from datalib.ds_attributes
order by datasetname;
%readtbl(tbl=&tbl);
quit;
%end;
%put &tbl;
%mend DATASET;
%dataset;
I am sure v can do this by assign any do loop function, but It reads only the first value of the variable and runs as many times as &DS, ultimately brings out an error.
Let me know if any solutions.