Resources

World Weather Online Data for London

/*----------------------------------------------------------------

                   SAS SAMPLE LIBRARY

       Name: raings02.sas
Description: Example program from SAS/ETS User's Guide,
             The SASERAIN Interface Engine
      Title: World Weather Online Data for London
    Product: SAS/ETS Software
       Keys: World Weather Online data extraction
      Procs: SASERAIN
      Notes: Read this before you run this sample.
             The sample data provided resides in the ets/sasmisc folder.
             If you are using automap=READONLY, then you must copy the
             map of your incoming XML data to a writeable folder before
             using it. So, define a system environment variable
             ,RAIN_DATA, to the path of your  writeable folder containing
             the FOGGY.MAP file and FOGGY.xml.
             To assign a fileref to the external file to be processed,
             use the following form of the libname statement:

           libname rain saserain "%sysget(RAIN_DATA)"
              FORMAT=XML
              OUTXML=foggy
              AUTOMAP=replace
              MAPREF=MyMap
              XMLMAP="%sysget(RAIN_DATA)foggy.map"
              APIKEY='<your World Weather Online apikey>'
              QUERY='London,United Kingdom'
              NUM_OF_DAYS=2
              TP=24;
              ;
 ----------------------------------------------------------------*/

options validvarname=any
   sslcalistloc="/SASSecurityCertificateFramework/1.1/cacerts/trustedcerts.pem";

title 'Retrieve Two Day Weather Forecast for London';
libname _all_ clear;

libname mylib "/sasusr/playpens/saskff/rain/doc/";

libname rain saserain "/sasusr/playpens/saskff/rain/test/"
   QUERY='London,United Kingdom'
   OUTXML=foggy
   XMLMAP="/sasusr/playpens/saskff/rain/test/foggy.map"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   NUM_OF_DAYS=2
   TP=24
   FORMAT=xml;

data mylib.london_fog;
   set rain.foggy;
run;

proc contents data=mylib.london_fog; run;
proc print data=mylib.london_fog; run;