SASEBLS Interface Engine
The LIBNAME libref SASEBLS Statement
LIBNAME libref SASEBLS 'physical-name' options;
The LIBNAME statement assigns a SAS library reference (libref) to the physical path of the directory where the SASEBLS interface engine stores the BLS economic data. The required physical-name argument specifies the final location of the folder where your BLS 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 (for example, /user/physical_name/) when you are in a UNIX environment.
You can specify the following options:
- ASPECTS=TRUE | FALSE
-
specifies whether or not to retrieve the aspects data that are associated with a given data point for a specified BLS series ID. For each observation, the associated aspects data consist of one or more name-value pairs of variables along with footnotes. When ASPECTS=TRUE and an aspect data file exists for the requested time series, the SASEBLS engine creates an auxiliary data set containing the aspects data. This auxiliary data set is named using the name specified in the OUTJSON= option, which is appended with "_data_aspects". For example, if OUTJSON=MYCPI, then the aspects data set is named
mycpi_data_aspects.sas7bdat.- TRUE
specifies that the aspects data be retrieved.
- FALSE
specifies that no aspects data be retrieved.
By default, ASPECTS=FALSE.
- CALCULATIONS=TRUE | FALSE
-
specifies whether to retrieve (TRUE) or not retrieve (FALSE) the net change and percentage change calculations available for 1, 2, 3, 6, or 12 months. Depending on the frequency of the data and the availability of the data, there might not be calculations
available for all intervals (1, 2, 3, 6, or 12 months).
- TRUE
retrieves the calculations.
- FALSE
does not retrieve the calculations.
By default, CALCULATIONS=FALSE. When CALCULATIONS=TRUE and a catalog is available for the requested time series, each calculation series is labeled appropriately. To see the labels, use the CONTENTS procedure with the output data set.
- CASLIB=bls_caslib_name
specifies the name of the CAS library (caslib) where the in-memory CAS table is stored when the JSON data from the BLS 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 BLS are read into SAS. 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.
- CATALOG=TRUE | FALSE
-
specifies whether or not to retrieve additional descriptive data about the requested time series. These catalog data include the series description (series title); the seasonality description; the survey name description; the survey abbreviation; and (where appropriate) descriptions such as measured data type, commerce industry, occupation, and regional area. When CATALOG=TRUE and a catalog is available for the requested time series, the SASEBLS engine creates an auxiliary data set that contains the catalog data. This auxiliary data set is named using the name specified in the OUTJSON= option, which is then appended with "_catalog". For example, if OUTJSON=MYCPI, then the catalog data set is named
mycpi_catalog.sas7bdat.- TRUE
retrieves additional descriptive data about the requested time series.
- FALSE
does not retrieve additional descriptive data about the requested time series.
By default, CATALOG=FALSE.
- CONNECT=ON | OFF
specifies whether to use (ON) or not use (OFF) the connect method along with the PROXY= option. Note: To use the connect method, you must use the PROXY= option and specify your proxy server in addition to the CONNECT=ON option. For more information about a secure connection, see the PROXY= option.
- DEBUG=ON | OFF
specifies whether or not to include diagnostic message logging in the SAS log window. This information can be useful for troubleshooting. Specify DEBUG=ON to see all the log messages (including debugging information) in the SAS log. By default, DEBUG=OFF.
- ENDYEAR='bls_endyear'
specifies the ending year of the time series in the format
YYYY.- FORMAT=bls_jsonformat
specifies the format of the file to be retrieved from the BLS website. Although BLS can report data in many formats, the SASEBLS engine supports only the JSON format (the default).
- FREQ='bls_frequency_code'
-
specifies the frequency of the data that you want to retrieve. You can specify the option values shown in the Frequency Code column in Table 2. For an example that retrieves monthly data, see Example 23.1.
Table 2: BLS Frequency Codes
Period Period Description Frequency Code Description M01–M12 Jan.–Dec. M Displays data on a monthly basis M13 Annual average M13 Displays annual averages of monthly data M01–M12 Monthly Mon Displays data on a monthly basis M01–M12 Monthly Month Displays data on a monthly basis M01–M12 Monthly Monthly Displays data on a monthly basis Q01–Q04 1st–4th quarter Q Displays data on a quarterly basis Q05 Annual average Q05 Displays annual averages of quarterly data Q01–Q04 1st–4th quarter QTR Displays data on a quarterly basis Q01–Q04 1st–4th quarter Quarter Displays data on a quarterly basis Q01–Q04 1st–4th quarter Quarterly Displays data on a quarterly basis S01–S02 1st–2nd half S Displays data on a semiannual basis S03 Annual average S03 Displays annual averages of semiannual data S01–S02 1st–2nd half Semiannual Displays data on a semiannual basis A01 Annual A or A01 Displays data on an annual basis A02 Annual average A02 Displays annual averages of annual data A02,S03,Q05,M13 Annual average Annual_avg Displays data for annual averages A01 Annual Year Displays data on an annual basis A01 Annual Yearly Displays data on an annual basis
- GOCAS=ON | OFF
specifies whether to create (ON) or not create (OFF) an in-memory CAS table of the BLS data (in addition to the SAS data set that is created). When GOCAS=ON, the SASEBLS engine assumes that there is an active CAS session running when it executes the LIBNAME statement. By default, GOCAS=OFF.
- INSET=bls_input_SAS_dataset_name
-
specifies the name of the input SAS data set that contains a list of time series to include in the output SAS data set. The list is in the following format:
DATA \Argument{bls\_input\_SAS\_dataset\_name}; seriesid = \Argument{\Squotes{bls\_seriesid\_name1}}; output; seriesid = \Argument{\Squotes{bls\_seriesid\_name2}}; output; . . . seriesid = \Argument{\Squotes{bls\_seriesid\_nameN}}; output; run;The BLS API enables you to retrieve up to 50 series IDs in one request. To see a list of all series IDs for a particular survey, such as CU, visit the web page at the following URL: https://download.bls.gov/pub/time.series/cu/cu.series .
The CPI and PPI survey names are as follows: CU, CW, SU, AP, LI, MU, MW, ND, PC, PD, WP, and WD. You can replace the 'CU' with a different survey name to see a list of that survey’s series IDs. For example, for the WD survey, use the following URL
: https://download.bls.gov/pub/time.series/wd/wd.series .
For examples that retrieve CPI and PPI data, see Example 23.1 and Example 23.2, respectively.
- OUTJSON=bls_json_file_name
specifies the name of the JSON file (downloaded to the SAS Work library) and the name of the SAS data set that is created when the JSON data are read into SAS. The SAS data set is stored in the folder that is specified by physical-name.
- PAYPATH='bls_payload_path_and_filename'
-
specifies the physical path and file name of the
payload.txtfile. Do not specify the .txt file extension, because the SASEBLS engine automatically adds .txt to the end of thepayload.txtfile name. Thepayload.txtfile iscreated by the engine and contains information from the INSET= option, as well as information from the following options: STARTYR=, ENDYR=, CATALOG=, and ASPECTS=.
- PROXY='bls_proxyserver'
specifies which proxy server to use. This option is not required. The specified proxy server is used only when a connection-refused error or a connection-timed-out error occurs. For bls_proxyserver, specify the server’s HTTP address followed by a colon and the port number, and enclose that string in double quotation marks; for example, PROXY="http://inetgw.unx.sas.com:8118". See also the CONNECT= option.
-
SETNAME=bls_setname
DATASETNAME=bls_setname
DATASET=bls_setname
SETID=bls_setname specifies the name of the BLS data set to retrieve the BLS data from. Table 3 shows the list of available BLS data set names. This release of SASEBLS supports the data set names shown in Table 4. See Example 23.1 for a CPI example, Example 23.2 for a PPI example, and Example 23.3 for an IPP example.
- STARTYEAR='bls_startyear'
specifies the starting year of the time series in the format
YYYY.-
USER='bls_user'
APIKEY='bls_user'
REGISTRATIONKEY='bls_user' specifies the unique user registration key, enclosed in quotation marks, that the BLS assigns to the user (subscriber) to allow access to the data provided by the BLS website. The BLS access key is a 32-character alphanumeric lowercase string that you can request from the website at the following URL: https://data.bls.gov/registrationEngine/ .