Hi,
I'm running a bash shell script and I want to make a call to a SAS DB to kick off a SAS procedure.
We're going to schedule this script in cron so we want the script to log into SAS and kick this procedure off.
What is the call to SAS from a bash shell script that does this? I know how to log into Neteeza and Oracle from Linux. I'm sure there's a way to log into SAS from Linux as well.
The strange thing is I "Googled" how to do this and all the returns were articles that talked about calling Linux shell scripts from SAS.
I want to go the other way around. The reason for this is because we want to leverage Linux cron.
Is that possible or would it be easier to call the script from SAS.
I'm seeing articles about being able to schedule processes in SAS.
So If there is no way to call SAS from a Linux shell script would it be possible to schedule this in SAS instead and just skip the Linux script all together?
This is only if we can't get this done in Linux.
Thanks in advance.
-Tater
What is your question exactly? You call SAS from a shell script the same way you would call any other program. SAS has a large number of command line options you can set, but the normal way to run it is to move to the folder where your program exists and then issue the command sas followed by the name of your program. SAS will then write the log and listing outputs into that folder. If you leave the extension off of the filename then SAS will look for a file with extension of .sas.
cd /home/me/myproject
sas myprogram
Right my question is about how you log in to SAS when calling that script.
1. You log into UNIX.
2. Write your shell script to call your SAS program or in your case, just call your SAS program.
3. Are you already logged into SAS? Does that happen in your .profile when you log into UNIX? Is the login in the SAS script itself?
4. Unless it's specified in your .login or .profile or whatever or unless you run a script that logs you into SAS for that UNIX session how do you invoke that script to run on SAS?
I guess that's my basic question.
You should not have to "logon to SAS". Your Unix server should be configured so that your userid is used to run SAS. Even if SAS is running on some other node because you are using SAS/Grid.
If you are trying to run a Unix script on a server that is not part of your SAS environment then perhaps you just need to use ssh to run the command on the appropriate server? If you make sure that all of your servers are using the same authentication then you should be able to do this output passing in user credentials.
That's kind of what I figured. I'm brand new to SAS so all I have to go off of is my experience with other DB platforms.
In this case for SAS it looks like the "login" is "silent" in that it's just part of the environment.
- 'nuff said...
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.