Running SAS in cygwin?

New Contributor
Posts: 2

Running SAS in cygwin?

Hello everyone,

I am new to SAS and cygwin especially. I have a written a very simple SAS code  with one data step and one proc print step pretty basic and saved the file as 

Now, I am trying to run the SAS code on the cygwin. In order to run SAS code on cygwin, it was recommended to add path in cygwin so I have already added the following path

export PATH=$PATH:/cygdrive/c/"Program Files"/SASHome/SASFoundation/9.4

and then when I echo Path it shows me this path is added and this is where my sas.exe file is. And then in my home dir when I do ls, it shows me my file

However, when I wan to execute this in unix, I just type the name and press enter to execute the file but it does not execute. Instead of that it gives me error that is not a bash command.

I just want to run this file.

Any suggestions?



Trusted Advisor
Posts: 3,215

Re: Running SAS in cygwin?

Would advice not to use Cygwin. It is a unix simulation often going aling with R for learning. The disadvantage is it is suited for learning not  professional usage.

You can use base sas running Windows, it will use all options of Windows. The disadvantage is the need for usage as a professional commercial license.

You can use sas in a learning edition for free. It will run SAS in a CENT-OS  unix version in a virtualize machine. The disadvantage with this one is is that closed you do not see the centos really you can learn to use that like the Cygwin environment.

---->-- ja karman --<-----
Super User
Posts: 10,238

Re: Running SAS in cygwin?

In order to directly "run" a file like, it has to be made executable with chmod. But this won't work, since you would then need a "shebang" (look up in wikipedia) at the beginning of the file to tell the shell (bash) which interpreter to use. But the shebang would cause a syntax error in SAS. So this simply won't work.

Instead enter "sas" on the commandline. But I can't guarantee that Windows SAS itself will run in the cygwin environment.

If you want to test SAS in a UNIX environment, use the real thing. cygwin is a tool for UNIXers to get work done on Windows without having to learn another (inferior) toolset; it's not a real OS.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation