SASEBLS Interface Engine
Example 23.10 Retrieving Business Employment Dynamics Statistics (BDM) Data
This example shows how to retrieve data from the Business Employment Dynamics Statistics survey. You can view these data by using the following URL:
https://www.bls.gov/bdm/data.htm
INSERIES is an input SAS data set that lists the IDs of the time series to be retrieved from the Business Employment Dynamics Statistics (BDM) database. In this example, the input SAS data set is named in the INSET=INSERIES option. To create the INSERIES data set, use the DATA step. In the DATA statement, the name of the input data set is specified as 'INSERIES'. Next, the length of the series ID is specified as 32 bytes prior to listing the ID of each series to be accessed. Each time series is listed on its own line, along with the OUTPUT statement. When the series IDs have been listed, the DATA step is ended with a RUN statement. The following SASEBLS LIBNAME statement specifies the libref (BLS), followed by the engine name (SASEBLS) and the physical path where the retrieved BLS data are to be stored. The OUTJSON= option names the file where the JSON data are stored. The output data set is created using the OUTJSON= option and placed in the folder that is specified in the SASEBLS LIBNAME statement. The INSET= option specifies the INSERIES data set for the list of series to retrieve using their IDs. In this example, four time series are requested, along with any calculations.
The date range of the data starts with 2019, as specified by the STARTYEAR= option. The ENDYEAR= option specifies the last year, 2020, to include in the range of data to retrieve. The FREQ=QUARTERLY (or FREQ=Q) option specifies the selection of quarterly data, but because the CALCULATIONS=TRUE option is specified, the retrieved data also include the net change calculation and percentage change calculation statistics. The FORMAT= option specifies that the data are to be retrieved using the JSON format. Output 23.10.1 shows the data that are retrieved. Output 23.10.2 shows the catalog information for the retrieved data.
options;
libname blscat "%sysget(BLS)"; /* for Catalog data set*/
DATA inseries;
length seriesid $ 32;
seriesid = 'BDS0000000000100030110004LQ5'; output;
seriesid = 'BDS0000000000200050110001LQ5'; output;
seriesid = 'BDS0000000000100000110001LQ5'; output;
seriesid = 'BDS0000000000200000110001LQ5'; output;
RUN;
title 'Retrieve Business Employment Dynamics Statistics Data';
libname bls sasebls "%sysget(BLS)"
USER='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
SETNAME=BDM
INSET=inseries
PAYPATH= "%sysget(BLS)payload"
OUTJSON=blsex10
STARTYEAR='2019'
ENDYEAR='2020'
FREQ=Quarterly
CALCULATIONS=true
CATALOG=true
FORMAT=json;
data myBDM;
set bls.blsex10;
run;
proc contents data=myBDM; run;
proc print data=myBDM; run;
Output 23.10.1: Business Employment Dynamics Statistics
| Retrieve Business Employment Dynamics Statistics Data |
| Obs | year | period | periodName | BDS0000000000100000110001LQ5 | BDS0000000000100000110001LQ5_3 | BDS0000000000100000110001LQ5_6 | BDS0000000000100000110001LQ5_12 | BDS0000000000100000110001LQ5%3 | BDS0000000000100000110001LQ5%6 | BDS0000000000100000110001LQ5%12 | BDS0000000000100030110004LQ5 | BDS0000000000100030110004LQ5_3 | BDS0000000000100030110004LQ5_6 | BDS0000000000100030110004LQ5_12 | BDS0000000000100030110004LQ5%3 | BDS0000000000100030110004LQ5%6 | BDS0000000000100030110004LQ5%12 | BDS0000000000200000110001LQ5 | BDS0000000000200000110001LQ5_3 | BDS0000000000200000110001LQ5_6 | BDS0000000000200000110001LQ5_12 | BDS0000000000200000110001LQ5%3 | BDS0000000000200000110001LQ5%6 | BDS0000000000200000110001LQ5%12 | BDS0000000000200050110001LQ5 | BDS0000000000200050110001LQ5_3 | BDS0000000000200050110001LQ5_6 | BDS0000000000200050110001LQ5_12 | BDS0000000000200050110001LQ5%3 | BDS0000000000200050110001LQ5%6 | BDS0000000000200050110001LQ5%12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2019 | Q01 | 1st Quarter | 1356 | -40 | 39 | -56 | -2.9 | 3.0 | -4.0 | 385 | 3 | -21 | 23 | 0.8 | -5.2 | 6.4 | 6108 | -220 | -75 | 23 | -3.5 | -1.2 | 0.4 | 164 | 20 | 17 | 6 | 13.9 | 11.6 | 3.8 |
| 2 | 2019 | Q02 | 2nd Quarter | 1378 | 22 | -18 | -38 | 1.6 | -1.3 | -2.7 | 424 | 39 | 42 | 48 | 10.1 | 11.0 | 12.8 | 6275 | 167 | -53 | 18 | 2.7 | -0.8 | 0.3 | 164 | 0 | 20 | 4 | 0.0 | 13.9 | 2.5 |
| 3 | 2019 | Q03 | 3rd Quarter | 1254 | -124 | -102 | -63 | -9.0 | -7.5 | -4.8 | 437 | 13 | 52 | 31 | 3.1 | 13.5 | 7.6 | 6144 | -131 | 36 | -39 | -2.1 | 0.6 | -0.6 | 161 | -3 | -3 | 14 | -1.8 | -1.8 | 9.5 |
| 4 | 2019 | Q04 | 4th Quarter | 1310 | 56 | -68 | -86 | 4.5 | -4.9 | -6.2 | 410 | -27 | -14 | 28 | -6.2 | -3.3 | 7.3 | 6521 | 377 | 246 | 193 | 6.1 | 3.9 | 3.0 | 155 | -6 | -9 | 11 | -3.7 | -5.5 | 7.6 |
| 5 | 2020 | Q01 | 1st Quarter | 1296 | -14 | 42 | -60 | -1.1 | 3.3 | -4.4 | 426 | 16 | -11 | 41 | 3.9 | -2.5 | 10.6 | 5739 | -782 | -405 | -369 | -12.0 | -6.6 | -6.0 | 153 | -2 | -8 | -11 | -1.3 | -5.0 | -6.7 |
| 6 | 2020 | Q02 | 2nd Quarter | 1045 | -251 | -265 | -333 | -19.4 | -20.2 | -24.2 | 1153 | 727 | 743 | 729 | 170.7 | 181.2 | 171.9 | 4674 | -1065 | -1847 | -1601 | -18.6 | -28.3 | -25.5 | 99 | -54 | -56 | -65 | -35.3 | -36.1 | -39.6 |
| 7 | 2020 | Q03 | 3rd Quarter | 1491 | 446 | 195 | 237 | 42.7 | 15.0 | 18.9 | 468 | -685 | 42 | 31 | -59.4 | 9.9 | 7.1 | 9383 | 4709 | 3644 | 3239 | 100.7 | 63.5 | 52.7 | 206 | 107 | 53 | 45 | 108.1 | 34.6 | 28.0 |
| 8 | 2020 | Q04 | 4th Quarter | 1463 | -28 | 418 | 153 | -1.9 | 40.0 | 11.7 | 379 | -89 | -774 | -31 | -19.0 | -67.1 | -7.6 | 7334 | -2049 | 2660 | 813 | -21.8 | 56.9 | 12.5 | 174 | -32 | 75 | 19 | -15.5 | 75.8 | 12.3 |
The following statements print the catalog data shown in Output 23.10.2:
libname blscat "%sysget(BLS)";
data myCAT;
set blscat.blsex10_catalog;
run;
proc print data=myCat; run;
Output 23.10.2: Catalog for Business Dynamics Statistics
| Retrieve Business Employment Dynamics Statistics Data |
| Obs | ordinal_series | ordinal_catalog | series_title | series_id | seasonality | survey_name | survey_abbreviation | measure_data_type | commerce_industry | commerce_sector | area |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | Gross job gains for the goods-producing sector in the U.S. (rounded to the nearest thousands) | BDS0000000000100000110001LQ5 | Seasonally Adjusted | Business Employment Dynamics | BD | Gross Job Gains | Goods-producing | Private Sector | U.S. totals |
| 2 | 2 | 2 | Gross job losses for the manufacturing sector in the U.S. (rounded to the nearest thousands) | BDS0000000000100030110004LQ5 | Seasonally Adjusted | Business Employment Dynamics | BD | Gross Job Losses | Manufacturing | Private Sector | U.S. totals |
| 3 | 3 | 3 | Gross job gains for the service-providing sector in the U.S. (rounded to the nearest thousands) | BDS0000000000200000110001LQ5 | Seasonally Adjusted | Business Employment Dynamics | BD | Gross Job Gains | Service-providing | Private Sector | U.S. totals |
| 4 | 4 | 4 | Gross job gains for the information sector in the U.S. (rounded to the nearest thousands) | BDS0000000000200050110001LQ5 | Seasonally Adjusted | Business Employment Dynamics | BD | Gross Job Gains | Information | Private Sector | U.S. totals |