The SASERAIN Interface Engine

Example 54.4 Retrieving the Local Weather Forecast for Three Locations

(View the complete code for this example.)

This example shows how to retrieve World Weather Online data for three locations (London, Paris, and Dubai), starting today and ending today (num_of_days=1), with a 24-hour frequency. The output is shown in Output 54.4.1.



options validvarname=any;

title 'Retrieve Weather Data for Three Cities';
libname mylib "/sasusr/rain/doc/";
libname rain saserain "%sysget(RAIN_DATA)"
   apikey='XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   query='London,United Kingdom;Paris,France;Dubai,United Arab Emirates'
   format=XML
   outXml=tricity
   automap=replace
   mapref=MyMap
   xmlmap="%sysget(RAIN_DATA)tricity.map"
   num_of_days=1
   tp=24
   ;

data mylib.threecit;
   set rain.tricity;
run;
proc contents data=mylib.threecit; run;
proc print data=mylib.threecit; run;

Output 54.4.1: Local Weather for London, Paris, and Dubai

Retrieve Weather Data for Three Cities

ObsdateAreaNameCountryRegionoclatitudelongitudemaxtempCmaxtempFmintempCmintempFtotalSnow_cmsunHouruvIndextimetempCtempFwindspeedMileswindspeedKmphwinddirDegreewinddir16PointweatherCodeweatherDescprecipMMhumidityvisibilitypressurecloudcoverHeatIndexCHeatIndexFDewPointCDewPointFWindChillCWindChillFWindGustMilesWindGustKmphFeelsLikeCFeelsLikeFchanceofrainchanceofremdrychanceofwindychanceofovercastchanceofsunshinechanceoffrostchanceofhightempchanceoffogchanceofsnowchanceofthunder
12018-05-11LondonUnited KingdomCity of London, Greater London151.5170-0.106018641254006241864914161SSE299Moderate rain at times0.7000057181016531458642145711171457870087000000
22018-05-11ParisFranceIle-de-France248.86702.333022711558006242271610119ESE116Partly cloudy0.0000052191017131661642166071216600870338800000
32018-05-12DubaiUnited Arab EmiratesDubai325.252055.280038101298400122438101814178S116Partly cloudy0.000003320100503492155933911525349208004279096000


Last updated: August 11, 2020