SAS jobs using Unix

Frequent Contributor
Posts: 90

SAS jobs using Unix

Hi All,

I need to run SAS jobs using UNIX environment.

So I have created a simple shell script and given

sas <job_name> 

But I am getting the following error

sh: sas: not found.

Kindly help me to resolve this.

Super User
Posts: 5,257

Re: SAS jobs using Unix

Valued Guide
Posts: 3,208

Re: SAS jobs using Unix

To add with Linus reply: get some basics on using Unix in a generic way. It is not only SAS. Are there people around you willing to help you with that? 

---->-- ja karman --<-----
Super User
Posts: 6,946

Re: SAS jobs using Unix

The error message simply means that the directory where SAS resides is not in your "search path".

The "search path" in UNIX is actually the environment variable PATH (case sensitive!), where the paths to be searched for executables are listed, separated by ":". The shell program (sh), which processes your commands, uses this.

You can display the PATH variable by entering "echo $PATH".

It usually looks quite like this:


The period at the end means to always search the current directory last, mimicking the default behaviour of DOS/Windows. Many installations will not have this, for security reasons.

You can avoid the problem by entering the absolute path to SAS, which starts with a "/" (this path therefore includes everything starting at the root directory of the operating system). You have to know exactly where SAS is installed to do this.

Another option is to have the system administrator include the path to SAS in the global definition of the PATH variable.

Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation