Skip to content

SDMX Connector for STATA

Attilio Mattiocco edited this page Sep 29, 2022 · 20 revisions

All the instructions that follow refer to linux, but they can be easily adapted to Windows installations.


How to build it

The only part of the connector that needs to be built is the Java library. Instructions can be found in the java section

NOTE: building the java library is not strictly necessary. A jar file, ready to be used in STATA, can be found in the release jar subdirectory


How to install it

  1. Download the latest stable release from the downloads section of the releases page and unpack it. Get the ado files from the project STATA directory.

  2. The ado files are such that, if located in a standard adopath, they are immediately available to the user. For checking the configured adopath you can use the STATA command sysdir.

  3. The SDMX Java library (SDMX.jar) needs to be added to the STATA CLASSPATH. This can be achieved by copying it in a jar subdirectory of the same adopath directory that is used for the ado files. (Note that the STATA release directory structure is such that it can be copied as is in a STATA adopath and everything should be fine).

  4. If necessary, override the default configuration by means of a custom configuration file. This is particularly necessary if you want to run the connector in an environment that connects to the internet by means of a proxy.

If you need more information about the STATA and JAVA integration, you can refer to the STATA documentation about the JAVA plugins and javacall


How to use it

Calling the graphical SDMX helper: sdmxHelp command. Just type:

sdmxHelp

Get data and metadata: getTimeSeries command. This command can take the following parameters:

provider: the name of the data provider (mandatory)
query: the time series query (mandatory)
startPeriod: the start time of the data to be retrieved (optional)
endPeriod: the end time of the data to be retrieved (optional)
metadata: 0: data only, 1: data and metadata, 2 metadata only (optional)
clearData: set this to true to force a clean-up of the current dataset (optional)

Examples:

single time series, freq=A, CURRENCY=USD
getTimeSeries ECB EXR/A.USD.EUR.SP00.A

multiple time series, FREQUENCY=A (annual), all currencies
getTimeSeries ECB EXR/A..EUR.SP00.A

same as above, include metadata and force current dataset clearing
getTimeSeries ECB EXR/A..EUR.SP00.A "" "" 1 1

multiple time series, FREQUENCY=A (annual), all currencies, from year 2000 to 2010
getTimeSeries ECB EXR/A..EUR.SP00.A 2000 2010

get data and metadata, FREQUENCY=A (annual), GBP and USD currencies
getTimeSeries ECB EXR/A.USD+GBP.EUR.SP00.A "" "" 1

same as above, get metadata only and clear the current dataset
getTimeSeries ECB EXR/A.USD+GBP.EUR.SP00.A "" "" 2 1