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

                   SAS SAMPLE LIBRARY

       Name: fredex09.sas
Description: Example program from SAS/ETS User's Guide,
             The SASEFRED Interface Engine
      Title: Specifying the URL= Option to Create TAGS_SERIES4 Data Set.

    Product: SAS/ETS Software
       Keys: FRED data extraction
      Procs: SASEFRED
      Notes: Read this before you run this sample.
             The sample data provided resides in the ets/sasmisc folder.
             Define a system environment variable,
             FRED, to the path of your  writeable folder containing
             the XFREDtpu.xml as your destination folder for FRED data.
             To assign a fileref to the external file to be processed,
             use the following form of the libname statement:

           libname fred sasefred "%sysget(FRED)"
              URL="https://api.stlouisfed.org/fred/tags/series?
                   tag_names=slovenia;food;oecd"
              APIKEY='< your FRED apikey >'
              ;
 ----------------------------------------------------------------*/


options validvarname=any;

title 'Specifying the URL= Option to Create the TAGS_SERIES4 Data Set.';
libname _all_ clear;
libname mylib "< path to your folder for data >";
libname fred4 sasefred "%sysget(FRED)"
  debug=on
  URL="https://api.stlouisfed.org/fred/tags/series?tag_names=slovenia;food;oecd"
  APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
  ;

data mylib.tags_series4;
   set fred4.XFREDtpu;
run;


proc print
   data=mylib.tags_series4(obs=2);
run;

proc contents
   data=mylib.tags_series4;
run;