1 The SAS System 07:42 Tuesday, February 9, 2021 1 ;*';*";*/;quit;run; 2 OPTIONS PAGENO=MIN; 3 %LET _CLIENTTASKLABEL='Bruno_sas'; 4 %LET _CLIENTPROJECTPATH='Z:\research\CD_Epis\Bijay\COVID19\dailyreport\archive\Weekly_Epi_Dashboard_test.egp'; 5 %LET _CLIENTPROJECTNAME='Weekly_Epi_Dashboard_test.egp'; 6 %LET _SASPROGRAMFILE=; 7 8 ODS _ALL_ CLOSE; 9 OPTIONS DEV=ACTIVEX; 10 GOPTIONS XPIXELS=0 YPIXELS=0; 11 FILENAME EGSR TEMP; 12 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR STYLE=HtmlBlue 12 ! STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/5.1/Styles/HtmlBlue.css") NOGTITLE NOGFOOTNOTE 12 ! GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on"); NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR 13 14 GOPTIONS ACCESSIBLE; 15 Data have; 16 length Region $6; 17 Input Region RepDate cnt_11FNC avg_11FNC; 18 informat RepDate ANYDTDTE10.; 19 FORMAT Repdate mmddyy10.; 20 Datalines; NOTE: The data set WORK.HAVE has 56 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 77 ; 78 79 proc sort data=Have; 80 by Region RepDate; 81 run; NOTE: There were 56 observations read from the data set WORK.HAVE. NOTE: The data set WORK.HAVE has 56 observations and 4 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 82 83 /* Do analysis to find trend. */ 84 data Trend; 85 length Region $6 Trend $ 10; 86 input Region Trend; 87 datalines; NOTE: The data set WORK.TREND has 4 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 92 ; 93 2 The SAS System 07:42 Tuesday, February 9, 2021 94 /* Merge results with original data */ 95 data Want; 96 merge Have Trend; 97 by Region; 98 run; NOTE: There were 56 observations read from the data set WORK.HAVE. NOTE: There were 4 observations read from the data set WORK.TREND. NOTE: The data set WORK.WANT has 56 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 99 100 ods escapechar="^"; 101 102 %macro plots; 103 %local i nObs region trend ; 104 title "Counts by Region"; 105 ods graphics / width=300px height=250px; 106 ods layout gridded columns=3; 107 108 proc sql noprint; 109 select distinct 110 region 111 , trend 112 into 113 :regionValue1 - 114 , :trendValue1 - 115 from 116 want 117 ; 118 %let nObs = &sqlobs; 119 quit; 120 121 %do i = 1 %to &nObs; 122 %let region = &®ionValue&i; 123 %let trend = &&trendValue&i; 124 %put NOTE: &sysmacroname processing &i of &nobs &=region &=trend; 125 %let title2line =; 126 127 ods region; 128 title1 "®ion"; 129 130 /*title "Counts by Region";*/ 131 %if &trend = Decreasing %then 132 %do; 133 title2 c=red "&trend^{unicode 2198}"; 134 %end; 135 136 %if &trend = Increasing %then 137 %do; 138 title2 c=blue "&trend^{unicode 2197}"; 139 %end; 140 141 %if &trend = Neutral %then 142 %do; 3 The SAS System 07:42 Tuesday, February 9, 2021 143 title2 c=black "&trend^{unicode 2192}"; 144 %end; 145 146 proc sgplot data=Want noautolegend; 147 where region = "®ion"; 148 vbar RepDate / response=cnt_11FNC; 149 vline RepDate / response=avg_11FNC; 150 run; 151 152 %end; 153 154 ods layout end; 155 title; 156 %mend; 157 158 %plots NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time 0.00 seconds NOTE: PLOTS processing 1 of 4 REGION=East TREND=Decreasing NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.11 seconds cpu time 0.04 seconds NOTE: There were 14 observations read from the data set WORK.WANT. WHERE region='East'; NOTE: PLOTS processing 2 of 4 REGION=North TREND=Decreasing NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.09 seconds cpu time 0.01 seconds NOTE: There were 14 observations read from the data set WORK.WANT. WHERE region='North'; NOTE: PLOTS processing 3 of 4 REGION=South TREND=Increasing NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.09 seconds cpu time 0.03 seconds NOTE: There were 14 observations read from the data set WORK.WANT. WHERE region='South'; NOTE: PLOTS processing 4 of 4 REGION=West TREND=Neutral NOTE: PROCEDURE SGPLOT used (Total process time): real time 0.09 seconds cpu time 0.03 seconds NOTE: There were 14 observations read from the data set WORK.WANT. WHERE region='West'; 159 4 The SAS System 07:42 Tuesday, February 9, 2021 160 GOPTIONS NOACCESSIBLE; 161 %LET _CLIENTTASKLABEL=; 162 %LET _CLIENTPROJECTPATH=; 163 %LET _CLIENTPROJECTNAME=; 164 %LET _SASPROGRAMFILE=; 165 166 ;*';*";*/;quit;run; 167 ODS _ALL_ CLOSE; 168 169 170 QUIT; RUN; 171