Resources

Specifying the URL= Option to Create REL8 Data Set.

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

                   SAS SAMPLE LIBRARY

       Name: fredex11.sas
Description: Example program from SAS/ETS User's Guide,
             The SASEFRED Interface Engine
      Title: Specifying the URL= Option to Create REL8 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/source/releases?source_id=11"
              APIKEY='<your FRED apikey>'
              ;
 ----------------------------------------------------------------*/

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

title 'Specifying the URL= Option to Create the REL8 Data Set';
libname _all_ clear;
libname mylib "/sasusr/playpens/saskff/fred/doc/";

libname fred8 sasefred "/sasusr/playpens/saskff/fred/test/"
   debug=on
   URL="https://api.stlouisfed.org/fred/source/releases?source_id=11"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   ;

data mylib.rel8;
   set fred8.XFREDtpu;
run;

proc print
   data=mylib.rel8;
run;

proc contents
   data=mylib.rel8;
run;