This guide explains the basics of running common software on the NBER servers through a terminal. Each section explains both how to open the Graphical User Interface (GUI) version of the software, and how to run jobs directly in the command line.
Please note that you must be Remote Desktop connected into the servers to use most GUI versions of the software. If you would like to use software in a GUI on multiple servers, we would recommend that you connect via Remote Desktop to one of the servers and then SSH into all of the other servers you would like to use from there.
- To start, you need to connect to the server that you want to run software on. You can do this via SSH or via Remote Desktop (If you are trying to run software on the Aging servers then you will have to do both). If you are using Remote Desktop, open a Mate Terminal window to start the next step.
- Now that you are connected, you can open software by entering the command for the software into your terminal. The command is often just the software's name, but sometimes it varies. Below are some examples of common software, how to open them, and basic usage instructions.
Software
We suggest that you run jobs in the background through the command line, because with large datasets your jobs may take days to run. Backgrounded jobs will not be dependent on your connection to the servers, which means that you don't need to remain logged for the duration of their runtime, and your jobs are less likely to be affected by lost connections. At the bottom of this document we detail how to run jobs in the background.
Stata
To open Stata in its own window, enter xstata into the terminal. This will open a Stata window like the one shown below.
You can also run Stata directly in the terminal. To do this, type stata into the terminal. Your terminal will then display something that look like the image below.
For information on how to use Stata, use the help command, and read the Stata User's Guide.
To run a Stata program in the background so that you can safely exit your session with it running, enter the following into the terminal (not Stata):
stata -b [YOUR PROGRAM NAME].do &
RStudio
RStudio runs in a browser, so to open it, first open Firefox by entering firefox into the terminal. Once the Firefox window opens, enter <hostname>:8787, where <hostname> as an example is age1.nber.org into the search bar at the top of the window. This will take you to the RStudio login page. Enter your unix username and password (the credentials you used to SSH or Remote Desktop into the server) and you will be logged in, as shown below.
For information on how to use RStudio, use the help command, and read the RStudio User's Guide.
To run an RStudio program in the background so that you can safely exit your session with it running, enter the following into the terminal (not RStudio):
Rscript [YOUR PROGRAM NAME].R &
Python
To use a basic Python terminal, enter python3 into the terminal. This can be useful for basic testing and experimentation.
To write Python code, you will probably want to use your own IDE of choice outside of the NBER servers, then bring your finished program into the servers. You can also use Visual Studio Code, while connected to the servers via Remote Desktop. You can do this by opening it from the Applications tab, or by typing code into a Mate Terminal window, which will give you the window shown below.
To run a Python program in the background so that you can safely exit your session with it running, enter the following into the terminal:
python3 [YOUR PROGRAM NAME].py &
SAS
To use SAS, you must be connected to an SAS server such as sas1 or agesas1.
We strongly recommend against using the GUI version of SAS, because we have disabled SAS's method of starting up a web server as that was insecure. The effect of this is that you will not be able to retain your log and output files after you close the GUI windows.
To open SAS, enter sas into the terminal. This will open the multitude of windows shown below.
To run an SAS program in the background so that you can safely exit your session with it running, enter the following into the terminal (not SAS):
sas [YOUR PROGRAM NAME].sas &
Stat Transfer
To open Stat Transfer in its own window, enter stattransfer into the terminal. This will open a Stat Transfer window like the one shown below.
To transfer data between different formats using Stat Transfer in the terminal, simply enter the following command, replacing the bracketed sections with the relevant information:
st [OLD DATA FILE NAME].[OLD FILETYPE EXTENSION] [NEW DATA FILE NAME].[NEW FILETYPE EXTENSION] &
An example of this might be the following:
st stata_health_data.dta sas_health_data.sas7bdat &
This command will convert the Stata formatted file "stata_health_data.dta" into a SAS formatted file "sas_health_data.sas7bdat".
Backgrounding Jobs
You can run statistical jobs (and any other program) in the background by ending the command to run it with an &. When you run a program in this way, the system will give you a Process ID number (PiD) which you should record somewhere so you can interact with your job as it is running. When you run a job in this way, you will be able to safely log out and close all of your windows without ending your job accidentally.
To check on the status of a job running in the background, connect to the server your job is running on via SSH and enter the following into the terminal, replacing [PiD] with your job's Process ID:
ps [PiD]
To end one of your jobs which you no longer need, enter the following into the terminal, replacing [PiD] with your job's Process ID:
kill [PiD]
For support, please email it-support@nber.org.