SASEOECD Interface Engine
The LIBNAME libref SASEOECD Statement
The LIBNAME statement assigns a SAS library reference (libref) to the physical path of the directory of OECD data files in which the downloaded OECD JSON data are stored. The required physical-name argument specifies the location of the folder where your OECD JSON data reside. It should end with a backslash if you are in a Windows environment or a forward slash if you are in a UNIX environment.
You can specify the following options:
-
DEBUG=ON | OFF
-
specifies whether or not to include diagnostic message logging in the SAS log window. This information can be very useful for troubleshooting a problem.
-
ENDTIME=oecd_endTime
-
specifies the end date for requesting OECD data. Specify oecd_endTime in one of the formats shown in Table 2. The valid data range of available data varies with each OECD data set. You can check data availability by selecting the period that you want to download on the OECD data set’s web page and using the Export window to select the Developer API tab. You can preview the generated URL link for downloading the selected data by clicking Generate API queries. The URL for the data query shows the time period in the request. The OECD URL parameter, &EndTime=, corresponds to the SASEOECD engine’s ENDTIME= option.
-
INSETn=oecd_keylist_name
-
specifies the name of the input data set, INSETn, that contains the key values to select the data that you want to retrieve. There are n + 1 insets, depending on the dimensions of the OECD data set, where n cannot exceed 9. Key0 is defined in INSET0, Key1 is defined in INSET1, and so on, up to Keyn, which is defined in INSETn, where n < 10.
-
OUT=oecd_jsonfile
specifies the name of both the JSON file (downloaded) and the SAS data set that is created when the JSON data are read into SAS. You can use the OUT= option to name your JSON data file. It is stored in the SAS Work library. The SAS data set that is created (when the JSON data are read into SAS) is stored in the folder specified by physical-name, and you can refer to it by using the myLib libref in your SASEOECD LIBNAME statement.
-
SETID='oecd_setid'
-
specifies the OECD data set ID or code that enables you to access the data set corresponding to that code. The data set ID or code is the same one that you use on the OECD web page at the following URL:
http://stats.oecd.org/Index.aspx?DataSetCode=<your_data_set_code>
For a list of some of the available OECD data sets and their key fields, see Table 5 in the section Data Elements Reference: SASEOECD Interface Engine.
-
START=oecd_start
-
specifies the start date for requesting OECD data. Specify oecd_start in one of the formats shown in Table 2.
Table 2: Formats for START= Option and ENDTIME= Option
| Interval or Frequency |
Format |
| Year |
YYYY |
| Year-semester |
YYYY-S1 – YYYY-S2 |
| Year-quarter |
YYYY-Q1 – YYYY-Q4 |
| Year-month |
YYYY-M1 – YYYY-M12 |
The valid data range for available data varies with each OECD data set. You can check data availability by selecting the period that you want to download on the data set’s web page and using the Export window to select the Developer API tab. You can preview the generated URL link for downloading the selected data by clicking Generate API queries. The URL for the data query shows the time period in the request. The OECD URL parameter, &StartTime=, corresponds to the SASEOECD engine’s START= option.
Last updated: June 19, 2025