I have a CSV file that has a character variable of multiple formulas which reference the other variables in the dataset. I have tried to use the call execute function to apply that and it worked for only like 4 variables but I have 50 variables and 20 different formulas and feel like there is an easier way to resolve these formulas. I have 3500 obs in the dataset so using the call execute is taking forever. My code below is just super simple using call execute. Could I use an array? Any help would be awesome! data temp1; format formula $200.; input formula $ num denom num_admin num_ehr elig_pop; datalines; num/denom 17 250 . . . num_admin+num_ehr/elig_pop . . 5 10 350 num+num_admin+num_ehr/elig_pop 14 . 4 18 400 ; run; data temp2; set temp1; if _n_ eq 1 then call execute('data result;'); call execute(cats('num=',num,';')); call execute(cats('denom=',denom,';')); call execute(cats('num_admin=',num_admin,';')); call execute(cats('num_ehr=',num_ehr,';')); call execute(cats('elig_pop=',elig_pop,';')); call execute(cats('rate=',formula,';')); call execute('output;'); if last then call execute('run;'); run;
... View more