Resources

Retrieving Current Conditions for Paris

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

                   SAS SAMPLE LIBRARY

       Name: rainex03.sas
Description: Example program from SAS/ETS User's Guide,
             The SASERAIN Interface Engine
      Title: Retrieving Current Conditions for Paris

    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
             ,World Weather Online, to the path of your  writeable folder
             containing the RAINEX03.MAP file and RAINEX03.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)"
              OUTXML=rainex03
              AUTOMAP=replace
              MAPREF=MyMap
              XMLMAP="%sysget(RAIN_DATA)rainex03.map"
              APIKEY='<your World Weather Online apikey>'
              QUERY='<your list of location codes (separated by semicolons>'
              FORMAT=xml
              NUM_OF_DAYS=1
              CONDITIONS=ONLYCC
              ;
 ----------------------------------------------------------------*/

title 'Current Conditions for Paris';
libname _all_ clear;
options validvarname=any
   sslcalistloc="/SASSecurityCertificateFramework/1.1/cacerts/trustedcerts.pem";


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

libname myRain saserain "/sasusr/playpens/saskff/rain/test/"
   apikey='XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   query='Paris,France'
   num_of_days=1
   conditions=onlycc
   outxml=parcon
   automap=replace
   mapref=MyMap
   xmlmap="/sasusr/playpens/saskff/rain/test/parcon.map"
   format=xml
   ;

data mylib.parcon;
   set myRain.parcon;
run;


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