11-17-2014 09:29 PM
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 prac1.sas
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 prac1.sas
However, when I wan to execute this in unix, I just type the name prac1.sas and press enter to execute the file but it does not execute. Instead of that it gives me error that prac1.sas is not a bash command.
I just want to run this file.
11-18-2014 12:22 AM
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.
11-18-2014 02:23 AM
In order to directly "run" a file like prac1.sas, 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 prac1.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.