%let name=hunting_island_sc_paddlefest; /* Set your current-working-directory (to read/write files), if you need to ... %let rc=%sysfunc(dlgcdir('c:\someplace\public_html')); */ filename odsout '.'; /* Using data from: https://paddleguru.com/races/HuntingIslandSCPaddlefest2019/ In the form of ... Year Overall Division Name Number Age Gender Category Time 2018 1 1/3 Pete Greene 7 Master male High Performance Kayak (HPK) 00:42:58.00 */ filename tempfile "hunting_island_sc_paddlefest.txt"; data my_data; length name division age gender category $100; format time time_rounded time12.0; informat time hhmmss11.; infile tempfile lrecl=250 pad firstobs=2 dlm='09'x; input year overall division name bib_number age gender category time; hours=time/60/60; format avg_mph comma8.2; avg_mph=6/hours; /* round to the nearest minute for uniform horizontal plot jittering */ time_rounded=round(time,'00:01't); /* round to the nearest .1 mph for uniform horizontal plot jittering */ avg_mph_rounded=round(avg_mph,.1); length my_url $300; my_url="https://www.google.com/search?q="||trim(left(name))||" site:paddleguru.com"; run; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Hunting Island, SC Paddlefest Race") style=htmlblue; ods graphics / noscale /* if you don't use this option, the text will be resized */ imagemap tipmax=2500 imagefmt=png imagename="&name" width=800px height=600px noborder; title1 c=gray33 h=18pt "Hunting Island, SC Paddlefest (6 Mile Race)"; title2 h=5pt 'a0'x; ods escapechar='^'; proc sgplot data=my_data noborder; format time_rounded time5.; scatter x=year y=time_rounded / markerattrs=(color=blue size=6pt) transparency=.40 jitter=uniform url=my_url tip=(name time avg_mph year age gender category division overall); xaxis display=(nolabel) values=(2017 to 2019 by 1) type=discrete valueattrs=(color=gray33 size=11pt) offsetmin=.2 offsetmax=.2; yaxis display=(noline noticks) label="^{unicode '2190'x} Slower Time (hh:mm) Faster ^{unicode '2192'x}" labelattrs=(color=gray77 size=11pt) values=('00:30:00't to '02:00:00't by '00:15:00't) reverse valueattrs=(color=gray33 size=11pt) offsetmin=0 offsexmax=0 grid gridattrs=(pattern=dot color=gray88); run; proc sgplot data=my_data noborder; scatter x=year y=avg_mph_rounded / markerattrs=(color=blue size=6pt) transparency=.40 jitter=uniform url=my_url tip=(name time avg_mph year age gender category division overall); xaxis display=(nolabel) values=(2017 to 2019 by 1) type=discrete valueattrs=(color=gray33 size=11pt) offsetmin=.2 offsetmax=.2 ; yaxis display=(noline noticks) label="^{unicode '2190'x} Slower Speed (avg. mph) Faster ^{unicode '2192'x}" labelattrs=(color=gray77 size=11pt) values=(0 to 10 by 1) valueattrs=(color=gray33 size=11pt) offsetmin=0 offsexmax=0 grid gridattrs=(pattern=dot color=gray88) ; run; proc sort data=my_data; by descending year overall; run; data my_data; set my_data; length link $300 href $300; href='href='||quote(trim(left(my_url))); link = '' || htmlencode(trim(name)) || ''; run; options nobyline; proc print data=my_data label noobs style(data)={font_size=11pt} style(header)={font_size=11pt}; by year notsorted; label link='name' avg_mph='average mph'; var year link time time_rounded avg_mph age gender category division overall; run; quit; ODS HTML CLOSE; ODS LISTING;