I have a set of numbers that I need to collect the count for. Essentially, I need to perform : proc sql;
create table lala&i as
select count(*)
from singlefamilyhht
where persons=4 and hinc<.8*(i)
or
persons=3 and hinc< .9*(.8*(i))
or
persons=2 and hinc< .8*(.8*(i))
or
persons=5 and hinc< 1.08*(.8*(i))
or
persons=6 and hinc< 1.16*(.8*(i))
group by puma1;
quit; repeatedly for different medians (@i). I wrote the following code: %macro data;
%let median = {61000.00 68000.00 68400.00 88000.00 77400.00 84040.00 103000.00 65400.00 47800.00 75000.00 92000.00 80000.00 99000.00 64400.00 79300.00};
%do i = 61000 %to &median;
proc sql;
create table lala&i as
select count(*)
from singlefamilyhht
where persons=4 and hinc<.8*(i)
or
persons=3 and hinc< .9*(.8*(i))
or
persons=2 and hinc< .8*(.8*(i))
or
persons=5 and hinc< 1.08*(.8*(i))
or
persons=6 and hinc< 1.16*(.8*(i))
group by puma1;
quit;
%end;
%mend data; My log is as follows: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 72 73 %macro data; 74 %let median = {61000.00 68000.00 68400.00 88000.00 77400.00 84040.00 103000.00 65400.00 47800.00 75000.00 92000.00 74 ! 80000.00 99000.00 64400.00 79300.00}; 75 %do i = 61000 %to &median; 76 proc sql; 77 create table lala&i as 78 select count(*) 79 from singlefamilyhht 80 where persons=4 and hinc<.8*(i) 81 or 82 persons=3 and hinc< .9*(.8*(i)) 83 or 84 persons=2 and hinc< .8*(.8*(i)) 85 or 86 persons=5 and hinc< 1.08*(.8*(i)) 87 or 88 persons=6 and hinc< 1.16*(.8*(i)) 89 group by puma1; 90 91 quit; 92 %end; 93 %mend data; 94 95 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 108 Any recommendations?
... View more