Technical How-To’s & Notes
Technical How-To’s & Notes
Connecting Remotely to WRDS on Windows
Connecting Remotely to WRDS on Windows
1. STATA
Members of the Harvard Business School community can access the WRDS platform via Stata. Stata connects to WRDS through ODBC, a standard application programming interface for accessing database management systems. For this reason, it is important to follow these comprehensive step-by-step instructions, see https://www.stata.com/blog/wrds/Stata_WRDS.pdf.
When setting up the connection, please keep a few things to keep in mind:
- Be sure to have your WRDS username and password (the same information you use to log in on the WRDS website) on hand
- Know whether your machine is 64bit or 32-bit. You can check by typing “Control Panel” in the Start menu. From there, go to “System and Security”, and then click “System”. The operating system will be listed under “System type”
- Once you link STATA to the WRDS server, you will only be able to access the tables that HBS subscribes to. Therefore, all of the tables you see listed may not be available. If you get an error in STATA that reads, “permission denied SQLSTATE=42501”, HBS does not have a subscription to this dataset. You can check the subscriptions available to you by logging into your WRDS account.
2. SAS
SAS/Connect allows you to communicate with the WRDS Unix server from within a SAS program running on your computer. It works by establishing a connection from within PC SAS to the WRDS Unix SAS.
/**********************************************************************/;
/* Compute Services: Sample script to submit program remotely to WRDS */
/**********************************************************************/;
/* Set up the remote access environment: */
/* - Define the remote session in WRDS (=> wrds); */
/* - Specify the communication access method (=> comamid); */
%let wrds=wrds.wharton.upenn.edu 4016;
options comamid=TCP remote=WRDS;
signon username=_prompt_;
/* After SAS reads the signon statement and executes successfully, the LOG window
*/
/* will indicate that the link is established. You will be prompted for the WRDS
*/
/* username and password
*/
/* The commands between rsubmit and endrsubmit are passed to WRDS and executed there.
*/
/* The libnames and datasets are all relative to the remote server.
*/
/* For example, if you want to define a new libname on the server, you must use
*/
/* syntax appropriate to the server.
*/
/* Data placed in the temporary work space reside in the remote library and will be
*/
/* lost after the endrsubmit statement.
*/
rsubmit;
libname crsp '/wrds/crsp/sasdata';
proc means data=crsp.dport1;
run;
proc freq data=crsp.dport2;
tables permno / out=dport2;
run;
proc print data=dport2;
run;
endrsubmit;
signoff;
3. Others (Python, R, etc.)
Please see documentation from WRDS to connect in other programming environments, such as Python, R, and MATLAB.