I have a macro which inserts data into a table over a set of given time-frame.
It loops through a series of from-to dates (which are stored in a dataset) and runs the macro with a proc sql insert statement.
When checking the data at the end of all of this, I notice that only data from the final from-to period is in the new data set.
Here is my code when calling the macro in the data step.
data _null_;
set extract_insert_dates;
%insert_table_extract(put(extract_start, date11.),put(extract_end, date11.));
run;
Is there something else I should be calling in the data step for this to work and insert data (run the macro) for each of the from-to periods, as opposed to just the final one?