So you want to install SAS for Linux….
Step 1: Read the documentation for some hints on how to download and install the download manager, and the SAS software depot (if you are the SAS administrator).
Step 2 : Throw away the documentation. It will just confuse you after this point and it doesn’t help anyway.
I had installed SAS on a Ubuntu operating system once before, on a virtual machine running on Virtual Box running on an older computer in my office that has Windows XP. I couldn’t remember how I did it except that I ended up literally throwing away the documentation and just using Google to figure it out. Then I deleted the virtual machine later when I needed space on that computer.
This weekend I installed SAS on the computer in the living room that runs Linux. My husband received the computer for $100 in some raffle or something. It was a bit of a dilemma at first, because our other six computers are Macs and Dennis equates Windows with the anti-Christ, but, after a few minutes thought, he installed Ubuntu and all has been well, barring a few arm-wrestling matches with the little one over whether she was going to get to use it for Club Penguin or he was going to be able to use it for programming.
The good news is downloading the download manager and installing the SAS software depot was a piece of cake. I followed the instructions on the SAS install site and everything worked perfectly. It took a few hours to download, which was a bit surprising to me, since we just had FiOS installed on the promise of speeding things up, but for once no one tripped over a cord and disconnected the computer, spelled coke on the keyboard or any of those other things that always seem to happen when you are right in the middle of something.
I created the DVDs from the SAS software depot but they did not work. By “they did not work”, I mean that when I popped in the DVD and ran sudo /cdrom/setup.sh instead of giving me three options, one of which was to install the software, it launched right into creating a new software depot on the computer where I already had a software depot from which I had created the DVDs in the first place. Sort of an annoying Escher-type loop. FAIL !
If I was more of my usual self I would have been determined to figure this out, but, unfortunately, I only have about 10 or 11 productive hours when I am not in too much pain to work (this sucks) so I decided to go ahead and use the software depot which was installed and actually DID give me three options. So, here is what I did after having downloaded the software depot, and it did work.
LOG IN WITH ROOT ACCESS
1. cd to to the directory where your software depot is located, e.g.,
2. Make sure your default shell is bash
(If your default shell is NOT bash, in my case it was dash, you will get a message that says:
/bin/sh: illegal option -p
Since the pain medication is eating about 40% of my brain as well as a good bit of my productive hours (this sucks), I passed the problem along to the Windows-hating Dennis when he got home from the lab. He emailed me the following from the upstairs bedroom ….
In order to install SAS components without the “/bin/sh: illegal option -p” error which stops installation, your /bin/sh file must be pointing to bash.
To check this, in the terminal execute the command:
ls -l /bin/sh
The line you get in return should end in something like:
sh -> /bin/bash
if it just ends in sh, or something like sh -> /bin/dash, you need to replace it with a symbolic link to bash. To do this, execute the two following lines:
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh
3. Type sudo ./setup.sh
give your password
Just click along with the next screens and SAS should install no problem.
(The SAS documentation says to just type ./setup.sh but in my case that tells me I don’t have permission.)
Actually compared to the problems we had early on with SAS 9.2 for Windows, this was relatively pain free.
You need to create a work directory and assign it when you run SAS. I went to my home directory and created a directory named tmp.
Then, to invoke SAS, I did this
usr/local/SAS/SASFoundation/SAS92/9.2/sas -work tmp
and SAS started up just happy as could be.
Of course, at this point, three things occur to me.
- I had no data on this computer and no actual need for SAS on it at the moment, I just wanted to see if I could install it and get it to run.
- There must be something like a .login file where I can set the path and don’t need to specify the full path each time.
- I have yet to install SAS on Linux from DVDs. The last time I did it from an external disk drive that had the software depot on it.
Also, there was no Enterprise Guide and no Power and Sample Size application. Not sure if SAS does not make those for Linux or they just weren’t part of our license.
So, there you have it. SAS for Linux. Except for the little bash/ dash episode, it really wasn’t much trouble at all. We only have one person outside our department who wants to install it (the other three used the same external drive that I did), so I think I will just copy the software depot on to a flash drive and send it to him.
Maybe I’ll figure out the DVD thing when I feel better (this sucks) or much more likely I’ll give them to my wonderful assistant and have her figure it out while I write up my lectures for next week on calculating various effect sizes with SPSS, SAS Enterprise Guide for Data Management & Statistics and Basic Statistics using SPSS 14 (yes, unbelievably, we actually had a request for a class on that!)