Retrieving Data for Exports of Goods and Services (BOPXGSA)
/*----------------------------------------------------------------
SAS SAMPLE LIBRARY
Name: fredex02.sas
Description: Example program from SAS/ETS User's Guide,
The SASEFRED Interface Engine
Title: Retrieving Data for Exports of Goods and Services (BOPXGSA)
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 system environment variable
,FRED, to the path of your writeable folder containing
the FREDEX02.MAP file and FREDEX02.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=fredex02
AUTOMAP=replace
MAPREF=MyMap
XMLMAP="%sysget(FRED)fredex02.map"
APIKEY='<your FRED apikey>'
IDLIST='bopxgsa'
VINTAGE='2012-06-14'
OUTPUT=3
FORMAT=xml
;
----------------------------------------------------------------*/
options validvarname=any
sslcalistloc="/SASSecurityCertificateFramework/1.1/cacerts/trustedcerts.pem";
title 'Retrieve Data for the Exports of Goods and Service by Using Vintage Date';
libname _all_ clear;
libname fred sasefred "%sysget(FRED)"
OUTXML=fredex02
AUTOMAP=replace
MAPREF=MyMap
XMLMAP="%sysget(FRED)fredex02.map"
APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IDLIST='bopxgsa'
VINTAGE='2012-06-14'
OUTPUT=3
FORMAT=xml;
data export_vin;
set fred.fredex02 ;
run;
proc contents data=export_vin; run;
proc print data=export_vin; run;