I'm trying to modify all datasets (name of datasets follow certain orders, like data_AXPM061203900_20120104 , data_AXPM061203900_20120105, data_AXPA061204100_20120103, data_AXPA061204100_20120104) under work library. For example, I want to delete all missing value under the variable named "ask_price" in all datasets.
I am using the following to achieve this objective.
proc sql ;
create table data.mytables as
select *
from dictionary.tables
where libname = 'WORK'
order by memname ;
quit ;
%macro test;
proc sql ;
select count(memname) into: obs from data.mytables;
%let obs=&obs.;
select catx("_", "data", substr(memname, 6, 13), substr(memname,20,27))
into :setname1-:setname&obs.
from data.mytables;
quit;
%do i=1 %to &obs.;
data &&setname&i;
set &&setname&i;
if bid_price= '.' then delete;
%end;
%mend test;
%test;
Someone suggest that "This is possibly the least efficient (in programming terms) setup you can have. Every time you even access that data you need to go through all the loops, checks, getting the data from the filename etc. which is both resource nonsense, and prone to error." However, he didn't give me a detailed solution. In this case, could anyone give me more guidance?
select catx("_", "data", substr(memname, 6, 13), substr(memname,20,27))
Why is that not the same asselect memname
? – Joe