SAS jobs using Unix

Reply
Frequent Contributor
Posts: 101

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

Re: SAS jobs using Unix

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

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: 7,809

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:

/usr/bin:/usr/local/bin:/opt/freeware/bin;.

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
  • 200 views
  • 0 likes
  • 4 in conversation