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

Request Two Quarterly Investment Positions for 2013

The CONTENTS Procedure

Data Set NameWORK.MYIIPQObservations4
Member TypeDATAVariables3
EngineV9Indexes0
Created11/17/2021 16:46:15Observation Length22
Last Modified11/17/2021 16:46:15Deleted Observations0
Protection CompressedNO
Data Set Type SortedNO
Label   
Data RepresentationSOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64, LINUX_POWER_64  
Encodinglatin1 Western (ISO)  

Engine/Host Dependent Information
Data Set Page Size65536
Number of Data Set Pages1
First Data Page1
Max Obs per Page2960
Obs in First Data Page4
Number of Data Set Repairs0
Filename/sastmp/SAS_work78EB000042B6_lax95d04.unx.sas.com/myiipq.sas7bdat
Release CreatedV.0400M0
Host CreatedLinux
Inode Number2951562778
Access Permissionrw-r--r--
Owner Namesaskff
File Size128KB
File Size (bytes)131072

Alphabetic List of Variables and Attributes
#VariableTypeLenLabel
1DateChar6Date of observation
2FinLiabsExclFinDeriv_PosChar8U.S. liabilities excluding financial derivatives; quarterly not seasonally adjusted
3FinLiabsFoa_PosChar8U.S. liabilities to foreign official agencies; quarterly not seasonally adjusted

Request Two Quarterly Investment Positions for 2013

ObsDateFinLiabsExclFinDeriv_PosFinLiabsFoa_Pos
12013Q1245595655811800
22013Q2247052695739553
32013Q3252649125838401
42013Q4265738785943352


Last updated: July 09, 2026