SASEBEA Interface Engine
The LIBNAME libref SASEBEA Statement
LIBNAME libref SASEBEA 'physical-name' options;
The LIBNAME statement assigns a SAS library reference (libref) to the physical path of the directory where the SASEBEA interface engine stores the BEA economic data. The required physical-name argument specifies the final location of the folder where your BEA data reside in a SAS data set that is named in the OUT= option. The physical-name should end with a backslash (for example, C:\physical_name\) when you are in a Windows environment or a forward slash (/user/physical_name/) when you are in a UNIX environment.
You can specify the following options:
- AFFILIATION=bea_affiliation
-
specifies the affiliation classification of the services transactions for which to select BEA time series data. See Table 54 for a list of valid affiliation classifications.
- AREAORCOUNTRY=bea_areaorcountry
specifies the counterparty area or country for which to select BEA time series data. The requested data are organized according to the specified counterparty area(s) or countries. See Table 53 for a list of available counterparty area or countries for the IntlServTrade data.
- CASLIB=bea_caslib_name
-
specifies the name of the CAS library (caslib) where the in-memory CAS table is stored when the JSON data from the BEA website are read into SAS. You can use this option to name your caslib where the in-memory CAS table is stored. The default value is the name of the active caslib. The GOCAS=ON option is required when you specify the CASLIB= option.
-
CASOUT=libref.data-table
OUTCAS=libref.data-table -
specifies the name of the in-memory CAS table that is created when the JSON data from the BEA are read into SAS. You can use this option to name your in-memory CAS table. The default value is the name that you specify in the OUT= option. The in-memory table is created only when you also specify the GOCAS=ON option. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs.
-
CLASSIFICATION=bea_classification
CLASS=bea_classification -
specifies the name of the classification key (such as COUNTRY or INDUSTRY) with which to group BEA time series data. You can use this option to name one of the key classifications shown in Table 58. The requested data are organized according to the specified classification.
- COMPONENT=bea_component
-
specifies a position or a component in the change of position from the previous period.You can use this option to select a component or multiple components to retrieve BEA time series data. The requested data are organized according to the specified component(s). See Table 51 for a list of available components and their descriptions.
-
COUNTRY=bea_country
COUNTRIES=bea_country specifies the geographic area code of the country with which to select BEA time series data. You can use this option to select a geographic area to retrieve BEA time series data from. The requested data are organized according to the specified geographic area code(s). See Table 59 for a list of available country geographic area codes for MNE data, and see Table 48 for International Transactions Accounts (ITA) data.
- DEBUG=ON | OFF
specifies whether or not to include diagnostic message logging in the SAS log window. This information can be useful for troubleshooting a problem. By default, DEBUG=OFF.
- DESCRIPTION=LONG | SHORT
For data from the International Trade in Services, specifies whether to use the short BEA time series indicator (using indicators whose names start with the prefix 'TSI_Ist') as the time series label, or whether to use the long BEA time series description as the time series label. By default, DESCRIPTION=SHORT. When printing the output data set, it is useful to use the LABEL option on the PROC PRINT statement so that each column heading matches the BEA time series indicator for each time series variable. When DESCRIPTION=LONG and the LABEL option is used on the PROC PRINT statement, each column heading matches the time series description of each time series variable.
-
DIRECTIONOFINVESTMENT=OUTWARD | INWARD | STATE | PARENT
DIRECT_OF_INVEST=OUTWARD | INWARD | STATE | PARENT -
For data from the Direct Investment (DI) Multinational Enterprise (MNE) data set, specifies whether the direction is outward, as in US direct investment abroad, or inward, as in foreign investment in the United States.
For data from the Activities of Multinational Enterprises (AMNE) data set, in addition to OUTWARD or INWARD, specify STATE when requesting the data on a state level, or specify PARENT for data on US parent enterprises.
The DIRECTIONOFINVESTMENT= option is important to the NONBANKAFFILIATESONLY= option; together these two options influence the range of years of data to be retrieved. When DIRECTIONOFINVESTMENT=OUTWARD and NONBANKAFFILIATESONLY=0, the data that are retrieved range from 2009 to the present. When DIRECTIONOFINVESTMENT=INWARD and NONBANKAFFILIATES=0, the data that are retrieved range from 2007 to the present. When DIRECTIONOFINVESTMENT=OUTWARD and NONBANKAFFILIATESONLY=1, the data that are retrieved are for AMNE "outward" data up to 2008. When DIRECTIONOFINVESTMENT=INWARD and NONBANKAFFILIATESONLY=1, the data that are retrieved are for AMNE "inward" data up to 2006.
- FOOTNOTES=YES | NO
specifies whether or not to include footnotes in the retrieved data. By default, FOOTNOTES=NO.
-
FREQ=A | Q | QSA | QNSA | M
FREQUENCY=A | Q | QSA | QNSA | M
INTERVAL=A | Q | QSA | QNSA | M
PERIOD=A | Q | QSA | QNSA | M -
specifies the selection frequency for the time series. You can specify one of the following frequencies:
- A
specifies annual frequency.
- Q
specifies quarterly frequency.
- QSA
specifies seasonally adjusted quarterly frequency (ITA data set only).
- QNSA
specifies not seasonally adjusted quarterly frequency (ITA data set only).
- M
specifies monthly frequency.
- GEOFIPS=bea_geofips
-
specifies a list of the federal information processing system (FIPS) codes for state, county, or metropolitan statistical area (MSA) or other codes of the data to retrieve. You can specify bea_geofips as a comma-delimited string enclosed in double quotes. Specify GEOFIPS=STATE to select all states, GEOFIPS=COUNTY to select all counties, GEOFIPS=MSA to select all metropolitan statistical areas, GEOFIPS=MIC to select all micropolitan statistical areas, GEOFIPS=DIV to select all metropolitan divisions, GEOFIPS=CSA to select all combined statistical areas, or GEOFIPS=PORT to select all metropolitan and nonmetropolitan portions. The list can contain ANSI state-county codes or metropolitan area codes, which are described at the following web page:
https://transition.fcc.gov/oet/info/maps/census/fips/fips.txt
In addition, a comprehensive list of MSAs and their component counties is given at the following web page:
- GOCAS=ON | OFF
specifies whether to create (ON) or not create (OFF) an in-memory CAS table of the BEA data (in addition to the SAS data set that is created). When GOCAS=ON, the SASEBEA engine assumes that there is an active CAS session running when it executes the LIBNAME statement. By default, GOCAS=OFF.
-
INDUSTRY=bea_industries
INDUSTRIES=bea_industries specifies a list of the desired industries for the time series data selection. You can specify bea_industries as a comma-delimited string enclosed in double quotes. You can specify INDUSTRY=ALL to select all available industries. See Table 60 for a list of available industry codes.
- LINECODE=bea_linecode
specifies the line that corresponds to the statistic in a table that is required for the time series data selection. You can specify only one line code. You must use only one GEOFIPS= specification when you specify LINECODE=ALL. GEOFIPS=STATE, COUNTY, MSA, MIC, DIV, CSA, or PORT are treated as multiple GEOFIPS codes so these cannot be used with LINECODE=ALL. When a multiple GEOFIPS code is used, specify only one LINECODE (for example, LINECODE=1). This option is required.
-
NONBANKAFFILIATESONLY=0 | 1
NONBANKONLY=0 | 1 -
specifies whether to return data for nonbank affiliates only (1) or for both bank and nonbank affiliates (0). Specify NONBANKAFFILIATESONLY=0 for AMNE "outward" data from 2009 to present and for "inward" AMNE data from 2007 to present. Specify NONBANKAFFILIATESONLY=1 for AMNE "outward" data up to 2008 and for "inward" AMNE data up to 2006. This option is required when you specify the OWNERSHIPLEVEL= option.
-
OUT=bea_jsonfile
OUTJSON=bea_jsonfile
JSON=bea_jsonfile specifies the name of the JSON file (downloaded) and the name of the SAS data set that is created when the JSON data are read into SAS. You can use the OUT= option to name the JSON data file. It is stored in the SAS
Worklibrary. The SAS data set that is created (when the JSON data are read into SAS) is stored in the folder specified by physical-name. You can refer to it by using the myLib libref in the LIBNAME statement.-
OWNERSHIPLEVEL=0 | 1
OWNERS=0 | 1 specifies whether to return data for all affiliates (1) or to return data for majority-owned affiliates only (0). This option is used only with AMNE statistics and is required. When DIRECTIONOFINVESTMENT=PARENT, the OWNERSHIPLEVEL= option must be set to 1. You must specify the OWNERSHIPLEVEL= option to retrieve AMNE data.
-
SERIESID='bea_seriesid'
SERIESIDS='bea_seriesid'
INDICATOR='bea_seriesid'
SERIESINDICATOR='bea_seriesid' specifies a list of the BEA time series identifiers (or indicators) to retrieve, enclosed in quotes. You can specify bea_seriesid as a comma-delimited string enclosed in double quotes. For the ITA data set, you can specify INDICATOR=ALL to select all available indicators. See Table 24 through Table 47 for a list of available ITA indicator codes. For the MNE data set, you can specify SERIESID='0' to retrieve all the available series IDs whose criteria match the rest of the SASEBEA LIBNAME option specifications. Table 57 shows the list of BEA series identifiers for MNE data.
-
SETNAME=bea_setname
DATASETNAME=bea_setname
DATASET=bea_setname
SETID=bea_setname specifies the BEA data set name to retrieve the BEA data from. Table 2 shows the list of BEA data set names.
-
STATE=bea_statecode
STATES=bea_statecode specifies the unique two-digit state FIPS code to select which data are retrieved. Table 61 shows the list of state FIPS codes with their corresponding state names. Only one FIPS code is allowed.
-
TABLEID=bea_tableids
TABLEIDS=bea_tableids specifies the unique identifier of the table from which the data are retrieved. The available table IDs for the GDPbyIndustry data are listed in Table 17. The available table IDs for the UnderlyingGDPbyIndustry data are listed in Table 21. The available table IDs for the Input-Output Statistics data are listed in Table 52.
-
TABLENAME=bea_table
TABLE=bea_table specifies the name of the table from which the data are retrieved. Table 14 and Table 15 show the list of NIPA and Underlying NIPA table names. Fixed assets table names are shown in Table 22. Regional table names are shown in Table 62. This is a required option.
- TRADEDIRECTION=bea_tradedirection
specifies the direction of trade of the data to be retrieved. Table 55 shows the list of trade directions and their corresponding descriptions.
- TYPEOFINVESTMENT=bea_typeofinvestment
specifies the type of investment data to be retrieved. Table 50 shows the list of investment types and their corresponding descriptions.
- TYPEOFSERVICE=bea_typeofservice
specifies the type of service data to be retrieved. Table 56 shows the list of service types and their corresponding descriptions.
-
USER='bea_user'
ACCESSKEYID='bea_user' specifies the unique user access key, enclosed in quotes, that the BEA assigns to the user (subscriber) to allow access to the BEA economic statistics API data service.
-
YEAR=bea_years
YEARS=bea_years specifies a list of the desired years for the time series data selection. You can specify bea_years as a comma-delimited string enclosed in double quotes. If not specified, the default is set to "LAST5" (last 5 years). You can also specify "LAST10" to select the last ten years, or "ALL" to select all available years.