[pre]
PROC SQL ;
SELECT COUNT( distinct(rHID) ) INTO : rh_cnt FROM cbm_level ;
RUN;
%LET rh_cnt=%SYSFUNC(COMPRESS(&rh_cnt));
PROC SQL ;
SELECT DISTINCT rHID, 'rH Email'n ,'rH Name'n
INTO : rhid_1-:rhid_&rh_cnt.,
: rhemail_1 -: rhemail_&rh_cnt.,
: rhname_1 -: rhname_&rh_cnt.
FROM cbm_level ;
RUN;
%MACRO cbm_level_rep();
%DO I=1 %TO %EVAL(&rh_cnt.) %BY 1;
%LET rhid = %sysfunc(compress(&&rhid_&I..));
ods html body = "/sas/sasebi/apache/htdocs/BIU/Automation/PRIVELEGE_BANKERS/&rhid..html" style = normal;
title j=left bold font = zurichbt color = darkblue "
RH NAME - &&rhname_&I..";
title2;
footnote ;
proc report data = cbm_level style(report) = [just =left font = (zurich,11pt)] split= "*"
style(header)=[BACKGROUND =maroon bordercolor =balck foreground = white FONT=(zurich, 11PT) font_weight = bold]
style(column)=[background = white FONT=(zurich, 10PT)];
where rhid = "&rhid";
column cbmid 'cbm Name'n ("Target FY11" FY_target)
("YTD" ytd_target ytd_ach per_ach_ytd)
("MTD" mtd_target mtd_ach per_ach_mtd pbs avg_pbs)
("POINTS EARNED(MTD)"
'SB Accounts'n 'Current Accounts'n 'Fixed Deposits'n 'Fee Products'n
'GENERAL INSURANCE'n GOLD 'LIFE INSURANCE'n 'Savings Account Upgrades'n 'Current Account Upgrades'n
'AUTO LOAN'n 'HOME LOAN'n LAG PL LAP LAS 'Asset/ Agri Products'n );
define cbmid/noprint order = data;
DEFINE 'cbm Name'n/"CBM Name" style(column) = [font_weight = bold];
DEFINE FY_target/"Target" analysis format = comma10.;
DEFINE ytd_target/"EPS Target" analysis format = comma10.;
DEFINE ytd_ach/"EPS Achv." analysis format = comma10.;
DEFINE per_ach_ytd/"% Achv." COMPUTED format = percent10.2;
DEFINE mtd_target/"EPS Target" analysis format = comma10.;
DEFINE mtd_ach/"EPS Achv." analysis format = comma10.;
DEFINE per_ach_mtd/"% Achv." COMPUTED format = percent10.2;
define 'SB Accounts'n/ "SB Accounts (units)" format = 10.;
define 'Current Accounts'n/ "Current Accounts (units)" format = 10.;
define 'Current Account Upgrades'n / "Current Account Upgrades (units)" format = 10.;
define 'Savings Account Upgrades'n / "Savings Account Upgrades (units)" format = 10.;
define 'Fixed Deposits'n/ "Fixed Deposits (In Rs)" format = comma20.;
define 'Fee Products'n/ "Fee Products (In Rs)" format = comma20.;
define 'GENERAL INSURANCE'n/ "General Insurance (In Rs)" format = comma20.;
define GOLD/ "GOLD (In Rs)" format = comma20.;
define 'LIFE INSURANCE'n/ "Life insurance (In Rs)" format = comma20.;
define 'AUTO LOAN'n/ "Auto Loan (In Rs)" format = comma20.;
define 'HOME LOAN'n/ "Home Loan (In Rs)" format = comma20.;
define LAG/ "LAG (In Rs)" format = comma20.;
define PL/ "PL (In Rs)" format = comma20.;
define LAP/ "LAP (In Rs)" format = comma20.;
define LAS/ "LAS (In Rs)" format = comma20.;
define 'Asset/ Agri Products'n/ "Others (In Rs)" format = comma20.;
define pbs/'No. of PBs' analysis;
define avg_pbs/ "Avg. EPS/PB" computed format = comma10.;
rbreak after/summarize;
compute per_ach_ytd;
per_ach_ytd = ytd_ach.sum/ytd_target.sum;
endcomp;
compute per_ach_mtd;
per_ach_mtd = mtd_ach.sum/mtd_target.sum;
endcomp;
compute avg_pbs;
avg_pbs = mtd_ach.sum/pbs.sum;
endcomp;
compute 'cbm Name'n;
if _break_ = "_RBREAK_" then do;
call define(_row_,"style","style=[background =LIGHTGREY FOREGROUND =BLACK font_WEIGHT=BOLD]");
'cbm Name'n = 'Total';
end;
%DO s = 1 %to &cbm_cnt.;
IF cbmID = "&&cbmid_&s.." then do;
call define (_col_ ,"url","http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&&cbmid_&s...html");
end;
%end;
ENDCOMP;
quit;
title j=left font = zurichbt bold "
http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.percent.html>Click here for % PB Achievement";
title2 j= left font = zurichbt bold "
http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.ranksheet.xls>Click here for PB RANKING";
title3 j= left font = zurichbt bold "
http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.zeromtdranksheet.xls>Click here for Zero Achieved MTD";
title4 j= left font = zurichbt bold "
http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.zeroytdranksheet.xls>Click here for Zero Achieved YTD";
title5 j= left font = zurichbt bold "
http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.exception.xls>Click here for exception report";
proc report data = tse style(report) = [background = white bordercolor = white foreground = white borderwidth = 0] style(header) = [ bordercolor = white background = white foreground = white] style(column) = [ bordercolor = white background = white];
footnote;
quit;
ods html close;
%end;
%mend cbm_level_rep();
%cbm_level_rep;
[/pre]