Who this is for
Research faculty and PhD students in the Cornell SC Johnson College of Business who are logged in to a JCB research server and want to run statistical or programming software on it — SAS, Stata, MATLAB, R, Python, C/C++, Fortran, or Gauss.
Before you start
This article assumes you can already log in to a research server. If you have not set that up yet — requesting access, connecting over the Research VPN, and logging in — start with Connecting to the JCB research servers (VPN + login).
The three ways to run any program
Whatever the software, you can run a program three ways. The right choice depends on how long the job takes.
- Interactively — type the command and wait for it to finish: command your-program
- In the background — add an ampersand so you can keep using the same terminal: command your-program &
- In batch — use nohup so the job keeps running even after you log off: nohup command your-program &
Batch mode is especially useful for jobs that take hours or days, because logging off will not stop them. Small jobs and quick tests are fine to run interactively.
SAS
Run a SAS program from the command line:
- sas myprogram.sas — run it and wait
- sas myprogram.sas & — run it in the background
- nohup sas myprogram.sas & — run it in batch
To use the graphical SAS interface instead, type sas on its own, then open and run your file inside the interface.
SAS writes temporary work files while your program runs, and large jobs can create very large ones. Always point SAS at your own work directory — the folder Research Computing set up for you outside /home. Do not use your home directory, which is limited to 3 GB. Add the -work option when you run SAS:
sas -work /path/to/your-work-directory myprogram.sas
Replace /path/to/your-work-directory with the location of your own work folder. The same option works in the background and in batch, for example: nohup sas -work /path/to/your-work-directory myprogram.sas &
If you do not have a work directory yet, email research-computing@business.cornell.edu to request one. Please do not create your own folder on the shared drives.
Stata
- xstata — start the graphical Stata interface (a window like Stata on your PC); open your file and run it from there.
- stata — start Stata on the command line.
- stata -b do stataprogram — run an existing Stata do-file; add & to run it in the background.
MATLAB
Type matlab to start the graphical interface, then open and run your files inside it. To run a MATLAB program from the command line:
matlab -nojvm -nodisplay <program.m> program.out
where program.m is your MATLAB program (MATLAB programs must end in .m) and program.out is the output file. To quit MATLAB at any time, type quit at the MATLAB prompt.
R
- To use R interactively, type R at the command line; quit with q().
- To run an R program such as test.R, first make it executable with chmod 744 test.R, then run it with ./test.R.
Python
Run a Python program from the command line:
- python myprogram.py — run it and wait
- python myprogram.py & — run it in the background
- nohup python myprogram.py & — run it in batch
To use a specific version, substitute python2 (with pip2) or python3 (with pip3) for the python command.
C and C++
- Compile a C program with cc *.c
- Compile a C++ program with CC *.C (or CC *.cc)
Both produce an executable file named a.out that you can then run. To link to the math library, use cc prog.c -o prog -lm, which compiles prog.c, links the math library, and produces an executable named prog.
Fortran
Compile first, then run the resulting executable. Use f77 for Fortran 77 source files (suffix .f) and f90 for Fortran 90 source files (suffix .f90):
- f77 prog.f — produces an executable named a.out
- f77 prog.f -o prog — produces an executable named prog instead
Run the executable interactively with a.out (or prog), in the background with a.out &, or in batch with nohup a.out &. In batch mode the console output is written to a nohup.out file in the current directory. For larger multi-file builds you can put your compile and link commands in a script file — contact Research Computing if you'd like help setting one up.
Gauss
The research servers run Gauss version 22. Before you use Gauss for the first time, add two aliases to the end of the .bashrc file in your home directory. You most likely already have this file, so add to it rather than replacing it.
- Run these two commands, one at a time. Each one adds a line to the end of the file, and creates the file if you don't have one yet:
- echo 'alias gauss=/mnt/software/gauss22/gauss' >> ~/.bashrc
- echo 'alias tgauss=/mnt/software/gauss22/tgauss' >> ~/.bashrc
Make sure to type two greater-than signs (>>). A single > replaces the whole file instead of adding to it.
- Apply the change with source ~/.bashrc, or log out and back in.
- To check the setup, run grep gauss ~/.bashrc. You should see the two alias lines. You only need to do this setup once; running the commands again adds duplicate lines.
Then run Gauss:
- tgauss gaussprogram.e — run interactively on the command line
- tgauss -b gaussprogram.e — run as a batch job; or nohup tgauss gaussprogram.e &
- quit — exit Gauss
To use Gauss with its graphical window you need X-windows set up; then the gauss command starts a Gauss window.
Keeping an eye on your jobs
Because the servers are shared, keep an eye on the jobs you start:
- top — show running processes; use it to find the PID (process ID) of your job.
- renice 15 PID# — lower your job's priority so it is gentler on the shared server (priority runs 0–19; a higher number means lower priority). Use the PID you found with top.
Please be considerate of others running jobs on the same server.
Need help?
If a program won't run, or you're not sure which tool or mode to use, contact JCB Research Computing and we will help.
Please direct all questions and issues to research-computing@business.cornell.edu.
[edited via Jane by rtm25 on 2026-10-08 17:29 UTC]