I found myself repeating the below datastep five times. I know %macro can help me to save the effort of writting the script over and over again. However, I am unsure on how to use it. =/ Hoping someone can help me out!
Proc Summary Data = GIO_VOR Nway Missing;
Class month GioBike_Grp;
Var claimCount epy earnedPrem incurToDate;
Output out = Gccgrp (Drop = _Type_ _Freq_) Sum=;
Run;
Data Gccgrp;
Set Gccgrp;
Length Claims_Frequency 8. Loss_Ratio 8.;
Claims_Frequency = (claimCount/EPY) * 100;
Loss_Ratio = (incurToDate/earnedPrem) * 100;
Run;
Proc Summary Data = GIO_VOR Nway Missing;
Class month GioCover_Type;
Var claimCount epy earnedPrem incurToDate;
Output out = Gcover (Drop = _Type_ _Freq_) Sum=;
Run;
Data Gcover;
Set Gcover;
Length Claims_Frequency 8. Loss_Ratio 8.;
Claims_Frequency = (claimCount/EPY) * 100;
Loss_Ratio = (incurToDate/earnedPrem) * 100;
Run;
Proc Summary Data = GIO_VOR Nway Missing;
Class month GIO_Ageband;
Var claimCount epy earnedPrem incurToDate;
Output out = GAgeband (Drop = _Type_ _Freq_) Sum=;
Run;
Data Gageband;
Set GAgeband;
Length Claims_Frequency 8. Loss_Ratio 8.;
Claims_Frequency = (claimCount/EPY) * 100;
Loss_Ratio = (incurToDate/earnedPrem) * 100;
Run;
Proc Summary Data = GIO_VOR Nway Missing;
Class month GioChannel_Grp;
Var claimCount epy earnedPrem incurToDate;
Output out = Gchannel (Drop = _Type_ _Freq_) Sum=;
Run;
Data Gchannel;
Set Gchannel;
Length Claims_Frequency 8. Loss_Ratio 8.;
Claims_Frequency = (claimCount/EPY) * 100;
Loss_Ratio = (incurToDate/earnedPrem) * 100;
Run;
Proc Summary Data = GIO_VOR Nway Missing;
Class month GioBike_Make;
Var claimCount epy earnedPrem incurToDate;
Output out = Gbikemake (Drop = _Type_ _Freq_) Sum=;
Run;
Data Gbikemake;
Set Gbikemake;
Length Claims_Frequency 8. Loss_Ratio 8.;
Claims_Frequency = (claimCount/EPY) * 100;
Loss_Ratio = (incurToDate/earnedPrem) * 100;
Run;
Much Appreciated.
Yennie