Thank you both for you replies! After looking at your codes and speaking with others in the office we were able to create code to do what I was looking for. Below is the code for reference. %let varlist =
Variable1
Variable2
Variable3
Variable4
Variable5;
%macro Univariate();
%local i univ_variable ;
%do i=1 %to %sysfunc(countw(&varlist));
%let univ_variable = %scan(&varlist, &i);
%put &univ_variable;
proc sql;
create table Univariate_&univ_variable. as
select &univ_variable.,
sum(technical_premium) as TP,
sum(modeled_loss_costs_uncap_targ) as PPxCAT,
sum(loss_total) as PPwCAT,
sum(resprem_actuarial) as prem,
sum(ehy) as count,
calculated PPwCAT - calculated PPxCAT as CAT,
calculated TP - calculated PPwCAT as Other,
sum(LIAB_amt_bpmdl_wtd) as liab
from DATASET
group by &univ_variable.;
quit;
%end;
%mend;
%Univariate();
... View more