SAS "Connection Terminated" errors can be caused by a local firewall or local area network (LAN) setting that terminates any internet connection that is perceived to be inactive. If your PC SAS job spends a considerable amount of time using WRDS resources, there may be little or no communication between your PC and the WRDS server during that time. Your LAN or firewall may misinterpret this lack of communication as an "idle" (unused) connection and kill the PC SAS connection as a result.
You should be able to work around this problem by using an SSH program to "tunnel" the PC SAS connection through the SSH port on your PC. An SSH connection to the WRDS server should not be perceived by your LAN or firewall as being idle, and your PC SAS connection should remain open for the duration of your program.
The following procedure makes use of the recommended SSH client, PuTTY. You can download the current free version of PuTTY free of charge from here: https://the.earth.li/~sgtatham/putty/latest/x86/putty-0.63-installer.exe. During installation, you can accept all of the defaults.
After starting PuTTY SSH, you need to configure it to tunnel your PC SAS connection, as follows:
(1) Go to "Connection", "SSH", "Tunnels"
(2) Enter "4016" for source port, and 'wrds.wharton.upenn.edu:4016' for the destination
(3) Click "Add" (this forwards your local network port 4016 to our server, wrds.wharton.upenn.edu port 4016)
(4) Go to "Connection", "SSH", "X11"
(5) Click "Enable X11 forwarding"
(6) To save this information so that it automatically pre-populates PuTTY with the right settings, go to "Sessions"
(7) Enter "wrds.wharton.upenn.edu" under "Host Name (or IP address)" and enter a name for it in the "Saved Sessions" field under Sessions
(8) Click "Save".
You can also save it as the default session by clicking on the "Default Settings" line under "Saved Sessions" and clicking "Save" (you must have already filled out the settings you want it to save, of course).
Then to connect to WRDS:
(1) Connect your session through PuTTY.
(2) Login to the WRDS server (you'll be prompted for your WRDS password).
(3) After you have connected to the WRDS server with SSH, leave it running (you can minimize the SSH Secure Shell window to your taskbar).
(4) Start PC SAS.
IMPORTANT FINAL NOTE: One line in each PC SAS/CONNECT program must be modified slightly to enable it to be tunneled through SSH. Change the program line:
%let wrds = wrds.wharton.upenn.edu 4016;
%let wrds = localhost 4016;
That is, just change "wrds.wharton.upenn.edu" in this line to "localhost". After these changes are made, when you run your PC SAS/CONNECT program it will be using the SSH port on your PC (network port 22) to connect to the PC SAS program port on the WRDS server (network port 4016). This connection should not be perceived as being "idle" by your LAN or firewall, and your program should run without interruption.