1 / 8

Using SAS to Obtain Tornado GIS Data from the National Weather Center

Using SAS to Obtain Tornado GIS Data from the National Weather Center. Valentin Todorov Statistician Assurant Specialty Property. Agenda. Severe weather database at NWC filename statement in a nutshell SAS macro to get reports from NWC Final results Other uses of the filename statement.

urbana
Télécharger la présentation

Using SAS to Obtain Tornado GIS Data from the National Weather Center

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using SAS to Obtain Tornado GIS Data from the National Weather Center Valentin Todorov Statistician Assurant Specialty Property

  2. Agenda • Severe weather database at NWC • filename statement in a nutshell • SAS macro to get reports from NWC • Final results • Other uses of the filename statement

  3. Severe Weather Database at NWC • Serves as the official record keeper for tornado, wind and hail occurrences in the USA • Provides detailed information for severe weather events • GIS data: Latitude and longitude of the location • Event characteristics: Strength, direction and trajectory • Updates daily • Reports are stored in .CSV format and can be downloaded from: http://www.spc.noaa.gov/climo/reports/090916_rpts_torn.csv Date of Report

  4. filename Statement in a Nutshell • filename Refresher • File Access Method - http filename fileref <device-type> <'external-file'> <options>; filename fileref http “http://www...”; proc import datafile =; input …;

  5. SAS Macro to Get Reports from NWC %macro tornado(daydate); filename NOAAfile HTTP "http://www.spc.noaa.gov:80/climo/reports/&daydate._rpts_torn.csv"; proc import datafile = "NOAAfile" out= TORNADO.file&daydate. dbms=CSV replace; run; data TORNADO.file&daydate.; set TORNADO.file&daydate.; length F_Scale1 $3. Location1 $20. County1 $13. Comments1 $230.; Longitude=input(Lon,12.); Latitude=input(Lat,12.); F_Scale1=F_Scale; Location1=Location; County1=County; Comments1=Comments; drop F_Scale Location County Comments; date="&daydate"; run; %mend; %tornado(090907); %tornado(090906); %tornado(090905); %tornado(090904); …………………….. %tornado(090101); Location of reports GIS Coordinates Invoke the Macro above by changing the report date

  6. Final Results

  7. Other Uses of the filename Function • Obtain stock quotes from Yahoo! Finance1 • Access remote files by using the FTP protocol2 filename in url “http://finance.yahoo.com:80/d/quotes.txt?s=YHOO+IBM+HPQ&f=sl1d1t1c1ohgv&e=.txt”; data; infile in dsd end=eof termstr=crlf; input Ticker : $4. Price TradeDate : $10. TradeTime: $7. Change Open Hi Lo Volume; options nodate nonumber nocenter ls=70; run; filename in ftp ‘datafile' cd='/techsup/download/datastep/' user='anonymous' host='ftp.sas.com'; data inDataFile; infile in; input x $10. y 4.; run; 1 SUGI Paper 73-28, The URL-y Show: Using SAS LE and the URL Access Method to Retrieve Stock Quotes, Ted Conway 2 SUGI Paper 007-2007, The File Name Revisited, Yves DeGuire, Statistics Canada

  8. Questions

More Related