SASEBLS Interface Engine

Example 23.15 Retrieving Occupational Requirements Survey (ORS) Data

This example shows how to retrieve data from the Occupational Requirements Survey (ORS). You can view these data by using the following URL:

https://www.bls.gov/ors/data.htm

INSERIES is an input SAS data set that lists the time series IDs to be read from the OR 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 each series ID 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 IDs to retrieve. In this example, two time series are requested, along with any calculations. The date range of the data starts with 2022, as specified by the STARTYEAR= option. The ENDYEAR= option specifies the last year, 2022, to include in the range of data to retrieve. The FREQ=ANNUAL (or FREQ=A) option specifies the selection of annual data, and the CATALOG=TRUE option requests that catalog information be retrieved. The FORMAT= option specifies that the data are to be retrieved using the JSON format. Output 23.15.1 shows the data that are retrieved. Output 23.15.2 shows the catalog information for the retrieved data.


options validvarname=any;
libname blscat "%sysget(BLS)";     /* for Catalog data set*/

DATA inseries;
   length seriesid $ 32;
   seriesid = 'ORUC1000000000001167'; output;
   seriesid = 'ORUC1000000000001164'; output;
RUN;

title 'Retrieve Occupational Requirements Survey Data';
libname bls sasebls "%sysget(BLS)"
   USER='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   SETNAME=ORS
   INSET=inseries
   PAYPATH= "%sysget(BLS)payload"
   OUTJSON=blsex15
   STARTYEAR='2022'
   ENDYEAR='2022'
   FREQ=Annual
   CATALOG=true
   FORMAT=json;

data myORS;
   set bls.blsex15;
run;
proc contents data=myORS; run;
proc print data=myORS; run;

Output 23.15.1: Occupational Requirements Survey Data

Retrieve Occupational Requirements Survey Data

ObsyearperiodperiodNameORUC1000000000001164ORUC1000000000001167
12022A01Annual2.417.1


The following statements print the catalog information shown in Output 23.15.2:

proc contents data=blscat.blsex15_catalog; run;
proc print data=blscat.blsex15_catalog; run;

Output 23.15.2: Catalog for Occupational Requirements Survey Data

Retrieve Occupational Requirements Survey Data

Obsordinal_seriesordinal_catalogseries_titleseries_idseasonalitysurvey_namesurvey_abbreviationmeasure_data_typecommerce_industryoccupationoccupation_work_classrequirementstype_of_cases
111Percent of civilian workers; workload is controlled by machinery, equipment, or softwareORUC1000000000001164Not Seasonally AdjustedOccupational Requirements SurveyORPercentageAll workersAll workersAll workersCognitive and mental requirementsPace: Control of workload
222Percent of civilian workers; workload is self-pacedORUC1000000000001167Not Seasonally AdjustedOccupational Requirements SurveyORPercentageAll workersAll workersAll workersCognitive and mental requirementsPace: Control of workload


Last updated: July 09, 2026