SAS jobs using Unix

Frequent Contributor
Posts: 114

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,876

Re: SAS jobs using Unix

Posted in reply to Helannivas
Trusted Advisor
Posts: 3,215

Re: SAS jobs using Unix

Posted in reply to Helannivas

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: 10,215

Re: SAS jobs using Unix

Posted in reply to Helannivas

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
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation