%let name=california_earthquakes_2019; /* Set your current-working-directory (to read/write files), if you need to ... %let rc=%sysfunc(dlgcdir('c:\someplace\public_html')); */ filename odsout '.'; /* Go to this page: http://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1 Enter Beginning & Ending year as 2019 Scroll to bottom and select "Return All Selected Events in tab-delimited format for import into Excel" Click 'Search database' Then rename output as california_earthquakes_2019.tsv */ proc import out=quake_data datafile="california_earthquakes_2019.tsv" dbms=tab replace; datarow=2; getnames=yes; guessingrows=all; run; options timezone='America/Los_Angeles'; data quake_data; set quake_data; datestring=put(month,z2.)||'/'||put(day,z2.)||'/'||trim(left(year)); format date date9.; date=input(datestring,mmddyy10.); utc_datetimestring=trim(left(datestring))||':'|| put(hour,z2.)||':'||put(minute,z2.)||':'||put(second,z2.); format utc_datetime datetime.; utc_datetime=input(utc_datetimestring,anydtdtm.); format localdatetime dateampm40.; localdatetime=tzoneu2s(utc_datetime); run; data quake_data; set quake_data; length my_drill $300; my_drill='http://maps.google.com/maps?ie=UTF8&ll='||trim(left(latitude))||','||trim(left(longitude))||'&z=11'; /* my_drill='https://www.google.com/maps/@'||trim(left(latitude))||','||trim(left(longitude))||',11.5z'; */ run; /* This draws an outline of the state on the map, and also tells the map tile server to show an area bigger than just the area with the point-data. */ data state_outline; set mapsgfk.us_states (where=(statecode='CA')); run; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Significant California Earthquakes 2019") style=htmlblue; ods graphics / noscale /* if you don't use this option, the text will be resized */ imagemap tipmax=2500 imagefmt=png imagename="&name" noborder; ods graphics / width=400 height=400; proc sgmap plotdata=quake_data noautolegend; openstreetmap; scatter x=longitude y=latitude / markerattrs=(symbol=circlefilled size=6pt color='red'); scatter x=longitude y=latitude / markerattrs=(symbol=circle size=25pt color='red') transparency=.5; run; ods graphics / width=600px height=800px; proc sgmap plotdata=quake_data noautolegend mapdata=state_outline; openstreetmap; choromap / mapid=statecode; scatter x=longitude y=latitude / markerattrs=(symbol=circlefilled size=6pt color='red'); scatter x=longitude y=latitude / markerattrs=(symbol=circle size=25pt color='red') transparency=.5; run; ods graphics / width=600px height=800px; title1 color=gray33 height=20pt "Significant California Earthquakes 2019"; proc sgmap plotdata=quake_data noautolegend mapdata=state_outline; esrimap url="http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map"; choromap / mapid=statecode; scatter x=longitude y=latitude / markerattrs=(symbol=circlefilled size=6pt color='red'); scatter x=longitude y=latitude / markerattrs=(symbol=circle size=25pt color='red') transparency=.5; run; title1 link='http://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1' color=gray33 height=16pt "Significant California Earthquakes 2019"; proc print data=quake_data label noobs style(data)={font_size=11pt} style(header)={font_size=11pt}; label i_d='ID' latitude='Latitude' longitude='Longitude' year='Year' localdatetime='Local Date & Time' focal_depth='Focal Depth km' eq_mag_mw='Mw Magnitude' country='Country' state='State' location_name='Location'; var i_d latitude longitude localdatetime focal_depth eq_mag_mw country state location_name; run; quit; ODS HTML CLOSE; ODS LISTING;