Ability to run sas prog on remote server using SSH

Hi,
I am trying to run a sas prog on a remote server using ssh.

I have got the command that I am using in the below paragraph. With it, I was able to run shell scripts but when I tried 'sas' it errored out. I have got my keys exchanged so when I say ssh serverA I automatically connect to my remote server. (Note: All the commands in the quotations run one by one when they hit a semi-colon). I am running this on an AIX box.

When I run the below I get an error ksh: sas: not found.

ssh serverA "cd /directory/sas; pwd;ls; sas avi.sas"

Any help would be appreciated. I was thinking to do this in the above fashion. If there are any other suggestions on how to run a sas job on a remote server, please enlighten me.

Thanks,
Cool_avi

Is the executable file sas, and is it executable?
avi.sas is a parameter passed in?

Yes! This is an executable sas.

I tried to run the avi.sas from the remote server and it did run. The permissions are the same too. It just does not like the key word 'sas'. Once it reaches that point if bombs out saying ksh: sas: not found.

Please let me know if you need any other information.

Thanks,
Coolavi

so is avi.sas or sas the file you gonna execute?

ssh serverA "cd /directory/sas; pwd;ls; sas"

or

ssh serverA "cd /directory/sas; pwd;ls; avi.sas"

If it's genuinely "sas avi.sas" , probably sas is not in the environment. try abosulte path it.

ssh serverA "cd /directory/sas; pwd;ls; /path_to_sas/sas avi.sas"

Hi Lu,
That worked! :). I needed to invoke the sas before the running the prog using SSH. I did not look into that before because I was able to run the sas job on the command line on the remote server.

ssh serverA "cd /directory/sas; pwd;ls; /path_to_sas/sas avi.sas"
Thanks for the help Lu :),

Coolavi