Resources

Specifying Two Series Ids with Multiple Vintage Dates

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

                   SAS SAMPLE LIBRARY

       Name: fredex06.sas
Description: Example program from SAS/ETS User's Guide,
             The SASEFRED Interface Engine
      Title: Specifying Two Series Ids with Multiple Vintage Dates
             Using Output=2 Option and Descending Sort Order
    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.
             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 Windows system environment variable
             ,FACTSET, to the path of your  writeable folder containing
             the FREDEX06.MAP file and FREDEX06.xml.
             To assign a fileref to the external file to be processed,
             use the following form of the libname statement:

           libname fred sasefred "%sysget(FRED)"
              OUTXML=fredex06
              AUTOMAP=replace
              MAPREF=MyMap
              XMLMAP="%sysget(FRED)fredex06.map"
              APIKEY='<your FRED apikey>'
              IDLIST='ADJRES,ADJRESN'
              VINTAGE='2003-07-31,2006-08-31,2013-06-13'
              START='2004-01-01'
              END='2012-12-01'
              FREQ='bw'
              OUTPUT=2
              AGG='avg'
              SORT='desc'
              FORMAT=xml
              ;
 ----------------------------------------------------------------*/

title 'Specifying Two Series IDs with Multiple Vintage Dates and Descending Sort Order';
libname _all_ clear;

libname fred sasefred "%sysget(FRED)"
   OUTXML=fredex06
   AUTOMAP=replace
   MAPREF=MyMap
   XMLMAP="%sysget(FRED)fredex06.map"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   IDLIST='ADJRES,ADJRESN'
   VINTAGE='2003-07-31,2006-08-31,2013-06-13'
   START='2004-01-01'
   END='2012-12-01'
   FREQ='bw'
   OUTPUT=2
   AGG='avg'
   SORT='desc'
   FORMAT=xml;

data fredPDD;
   set fred.fredex06;
run;

proc contents data=fredPDD; run;
title3 "First 10/Last 10 Obs, IDLIST=ADJRES,ADJRESN, and SORT=Descending";
%pri20nom(fredPDD);
title3;