Resources

Retrieving Monthly Global Economic Monitor Commodities

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

                   SAS SAMPLE LIBRARY

       Name: wbgoex08.sas
Description: Example program from SAS/ETS User's Guide,
             The SASEWBGO Interface Engine
      Title: Retrieving Monthly Global Economic Monitor Commodities
    Product: SAS/ETS Software
       Keys: WBGO data extraction
      Procs: SASEWBGO
      Notes: Read this before you run this sample.
             The sample data provided resides in the ets/sasmisc folder.
             If you are using automap=READONLY, copy the
             map of your incoming XML data to a writeable folder before
             using it. Then you can define a system environment variable
             ,WBGO, to the path of your  writeable folder containing
             the WLDCOMM.MAP file and WLDCOMM.xml.
             To assign a fileref to the external file to be processed,
             use the following form of the libname statement:

          libname wbgo sasewbgo  "%sysget(WBGO)"
             countrylist='WLD'
             idlist='KSOYBEAN_MEAL,SOYBEAN_MEAL,SOYBEAN_OIL,KSOYBEAN_OIL,IFERTILIZERS'
             range='2016M01:2017M02'
             outxml=wldcomm
             AUTOMAP=replace
             MAPREF=MyMap
             XMLMAP="/sasusr/playpens/saskff/wbgo/test/wldcomm.map"
             FORMAT=xml;

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

title 'Retrieve Monthly Global Economic Monitor (GEM) Commodities';
libname wbgo sasewbgo "<physical pathname>"
   countrylist='WLD'
   idlist='KSOYBEAN_MEAL,SOYBEAN_MEAL,SOYBEAN_OIL,KSOYBEAN_OIL,IFERTILIZERS'
   range='2016M01:2017M02'
   outxml=wldcomm
   AUTOMAP=replace
   MAPREF=MyMap
   XMLMAP="<fully qualified filename to map file with .map file extension>"
   ;

data mywldcomm;
   set wbgo.wldcomm;
run;

proc contents data=mywldcomm; run;
proc print data=mywldcomm(drop=total_count); run;