I am currently trying to run some Stata code related to the WRDS database for my Ph.D. It is a postgres database requiring some configuration via ODBC. While isql connection via Terminal works, the command odbc list
in Stata returns the following error:
The ODBC file libodbc.dylib could not be found on this system. Setting the unix LD_LIBRARY_PATH environment variable may correct this error.
I mainly followed the tutorial on https://gist.github.com/JonathanWillitts/7b5a519bd40dd730b98ce1ad75e859e8, trying to adapt it to the Postgres requirements for the Database via homebrew and psqlodbc. I assume the error comes from the variable export via Terminal that I use:
export LD_LIBRARY_PATH=/opt/homebrew/lib/ && /Applications/Stata/StataSE.app/Contents/MacOS/StataSE &
I have had success downloading WRDS data into R using the RPostgres package.
If you do not figure out how to download WRDS data directly into Stata, a possible workaround is to:
Use R and the RPostgres package, and download the data into R
Then export the data from R into Stata, see: https://www.statmethods.net/input/exportingdata.html
https://datascienceplus.com/exporting-data-from-r/
I am happy to share R code for obtaining WRDS data. Let me know if this interest you and I can share my R code here.