I am trying to get record count form updated datasets using naming convention financial_account_YYYYMM that range from 201212 back to 200706. The datasets are stored in the following path: '/sas/data/dds_test/
The below code is not working for me and I am new to do loops> any help would be appreciated...
LIBNAME DDSTEST '/sas/data/dds_test/
proc sql;
create table rl_668_SUM
(
MNTH num,
CNT num
);
quit;
data _null_;
do i=200706 to 201212;
call execute('proc sql;
insert into rl_668_SUM
set MNTH='||strip(put(i,best.))||',
CNT = (select count(1) from DDSTEST.Financial_account_'||strip(put(I,best.)||');
quit;');
end;
run;