I am trying to add a column to a data table that was just created. Prior to this I've connected to a database and extracted the files of interest. The issue is that the lot ID is only contained in the file name and no where in the table itself. This will be an issue when I concatenate there files as I'll have no way distinguishing individual lots. So, I'm trying to create a new column containing the lot id which is the value contained in ParamList for that iteration of the macro. FYI, the sql step works fine. Any suggestions would be greatly appreciated. Thank you!
options symbolgen mprint;
%macro loop;
%do i=1 %to 10;
proc sql;
create table &&ParamList&i.._data as
select *
from Prod.&&ParamList&i.._DATA;
quit;
data &&ParamList&i.._data;
set &&ParamList&i.._data;
Run=%str(%'&&ParamList&i%'); /* Here's where I get into trouble */
%end;
%mend;
%loop;
The following works fine but is completely manual and not realistic given the quantity I need to pull.
data xyz_data_data;
set xyz_data;
runs='xyz';
run;