Skip to main content

SAS Tutorials: Connecting to WRDS from SAS

Directions for Connecting to WRDS from SAS without PuTTY

You can use this SAS code to connect to WRDS. Note that in order to connect to WRDS from SAS, you must not have a "class" or "library" acount.

/*Log into WRDS.*/
%let wrds=wrds.wharton.upenn.edu 4016;
options comamid=TCP remote=WRDS;
signon username=_prompt_;

/*After executing the above block (specifically, the username=_prompt_ line), you will receive a pop-up prompt to enter your WRDS username and password.*/
/*You are now logged into WRDS.*/

rsubmit;
/*Anything you submit here will be processed on WRDS's server.*/
endrsubmit;

/*Log out of WRDS.*/
signoff;

Connecting to WRDS from SAS with PuTTY

If you need to connect to WRDS for more than 1-2 hours, you will need to use PuTTY to keep the connection open.

Open PuTTY and connect to it per Wharton's instructions. Leave it running in the background. Then, open SAS and execute this syntax:

/*Log into WRDS.*/
%let wrds=localhost 4016;
options comamid=TCP remote=WRDS;
signon username=_prompt_;

/*You are now logged into WRDS.*/

rsubmit;
/*Anything you submit between "rsubmit;" and "endrsubmit;" will be processed on WRDS's server.*/
endrsubmit;

/*Log out of WRDS.*/
signoff;