Can someone PLEASE tell me why this code is so inefficient?
proc sql;
select
sum(
sum(a.gross_tot_afcollision_Sum)
, sum(a.gross_tot_collision_Sum)
, sum(a.gross_tot_damageparked_Sum)
, sum(a.gross_tot_duplicates_Sum)
, sum(a.gross_tot_maliciousdamage_Sum)
, sum(a.gross_tot_natural_Sum)
, sum(a.gross_tot_other_Sum)
, sum(a.gross_tot_theftentire_Sum)
, sum(a.gross_tot_theftother_Sum)
, sum(a.gross_tot_undefined_Sum)
, sum(a.gross_tot_windscreen_Sum)
, sum(a.gross_tot_withdrawn_Sum)
, sum(sum(b.tot_paid),sum(b.OutSt_Est)) * -1
)
into :grossSumRec
from
claimsanalysismaster as a
,claimsHeader as b;
quit;
proc sql;
select
sum(
sum(a.gross_tot_afcollision_Sum)
, sum(a.gross_tot_collision_Sum)
, sum(a.gross_tot_damageparked_Sum)
, sum(a.gross_tot_duplicates_Sum)
, sum(a.gross_tot_maliciousdamage_Sum)
, sum(a.gross_tot_natural_Sum)
, sum(a.gross_tot_other_Sum)
, sum(a.gross_tot_theftentire_Sum)
, sum(a.gross_tot_theftother_Sum)
, sum(a.gross_tot_undefined_Sum)
, sum(a.gross_tot_windscreen_Sum)
, sum(a.gross_tot_withdrawn_Sum)
, sum(sum(b.tot_paid),sum(b.OutSt_Est)) * -1
)
into :grossSumRec
from
claimsanalysismaster as a
,claimsHeader as b;
quit;
SAS Experts - Proc SQL question