SASEBEA Interface Engine
Example 22.9 Retrieving Quarterly Time Series for Two Types of Investments from the IIP Data Set
In this example, the BEA data set name is IIP, as specified in the SETNAME= option. The TYPEOFINVESTMENT= option specifies that the request is for two types of investments: US liabilities excluding financial derivatives and US liabilities to foreign official agencies. The COMPONENT= option requests the position statistics (POS) for the two specified investment types. The YEAR= option specifies that the selected data are for 2013, and the FREQ= option specifies the time period to be quarterly, not seasonally adjusted. The output is shown in Output 22.9.1, which contains three variables: DATE, FinLiabsExclFinDerivPos_QNSA, and TSI_IipFinLiabsFoaPos_QNSA. The CONTENTS procedure shows the attributes for each variable, including the description (shown as the label). The OUTJSON= option specifies the name of the SAS output data set, which is also the name of the JSON data file that is retrieved from the BEA website and read into SAS. Output 22.9.1 shows the output for the requested year, 2013.
options validvarname=any;
title 'Request Two Quarterly Investment Positions for 2013';
LIBNAME beaiip sasebea "physical path to your folder for storing the BEA data"
setname=IIP
typeOfInvestment="FinLiabsFoa,FinLiabsExclFinDeriv"
component=Pos
freq=QNSA
user='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
outjson=IIPQ
year='2013'
format=json;
data myIIPQ;
set beaiip.IIPQ;
run;
proc contents data=myIIPQ; run;
proc print data=myIIPQ; run;
Output 22.9.1: Position on FinLiabsFoa and FinLiabsExclFinDeriv: From the IIP Data Set for 2013
The CONTENTS Procedure
| WORK.MYIIPQ | 4 |
| DATA | 3 |
| V9 | 0 |
| 11/17/2021 16:46:15 | 22 |
| 11/17/2021 16:46:15 | 0 |
| | NO |
| | NO |
| | |
| SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64, LINUX_POWER_64 | |
| latin1 Western (ISO) | |
| 65536 |
| 1 |
| 1 |
| 2960 |
| 4 |
| 0 |
| /sastmp/SAS_work78EB000042B6_lax95d04.unx.sas.com/myiipq.sas7bdat |
| V.0400M0 |
| Linux |
| 2951562778 |
| rw-r--r-- |
| saskff |
| 128KB |
| 131072 |
| Date | Char | 6 | Date of observation |
| FinLiabsExclFinDeriv_Pos | Char | 8 | U.S. liabilities excluding financial derivatives; quarterly not seasonally adjusted |
| FinLiabsFoa_Pos | Char | 8 | U.S. liabilities to foreign official agencies; quarterly not seasonally adjusted |
| 2013Q1 | 24559565 | 5811800 |
| 2013Q2 | 24705269 | 5739553 |
| 2013Q3 | 25264912 | 5838401 |
| 2013Q4 | 26573878 | 5943352 |
Last updated: July 09, 2026