The SASERAIN Interface Engine

Example 53.3 Retrieving the Local Weather Forecast for One Location

(View the complete code for this example.)

This example shows how to use one World Weather Online location query to retrieve weather data for Dubai, starting today and ending tomorrow (num_of_days=2), with a 24-hour frequency. The output is shown in Output 53.3.1.


options validvarname=any;

title 'Retrieve Weather Data for Dubai';
libname mylib "/sasusr/rain/doc/";
libname myplace saserain "%sysget(RAIN_DATA)"
   apikey='XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   query='Dubai,United Arab Emirates'
   format=XML
   outXml=dubhot
   automap=replace
   mapref=MyMap
   xmlmap="%sysget(RAIN_DATA)dubhot.map"
   num_of_days=2
   tp=24
   ;

data mylib.hotdub;
   set myplace.dubhot;
run;
proc contents data=mylib.hotdub; run;
proc print data=mylib.hotdub; run;

Output 53.3.1: Local Weather for Dubai

Retrieve Weather Data for Dubai

ObsdateAreaNameCountryRegionoclatitudelongitudemaxtempCmaxtempFmintempCmintempFtotalSnow_cmsunHouruvIndextimetempCtempFwindspeedMileswindspeedKmphwinddirDegreewinddir16PointweatherCodeweatherDescprecipMMhumidityvisibilitypressurecloudcoverHeatIndexCHeatIndexFDewPointCDewPointFWindChillCWindChillFWindGustMilesWindGustKmphFeelsLikeCFeelsLikeFchanceofrainchanceofremdrychanceofwindychanceofovercastchanceofsunshinechanceoffrostchanceofhightempchanceoffogchanceofsnowchanceofthunder
12018-05-12DubaiUnited Arab EmiratesDubai125.252055.280038101298400122438101814178S116Partly cloudy03320100503492155933911525349208004279096000
22018-05-13DubaiUnited Arab EmiratesDubai125.252055.2800401033086001224401031728224SW116Partly cloudy03520100343697166235953149369709324375092000


Last updated: December 20, 2021