Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Using SAS to Obtain Tornado GIS Data from the National Weather Center Valentin Todorov Statistician Assurant Specialty Property."— 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: Date of Report

4 filename Statement in a Nutshell filename Refresher File Access Method - http filename fileref http “http://www...”; proc import datafile = ; input …; filename fileref ;

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); GIS Coordinates Invoke the Macro above by changing the report date Location of reports

6 Final Results

7 Other Uses of the filename Function Obtain stock quotes from Yahoo! Finance 1 Access remote files by using the FTP protocol 2 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 , The File Name Revisited, Yves DeGuire, Statistics Canada 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;

8 Questions


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

Similar presentations


Ads by Google