Architecting, installing and maintaining your SAS environment

Help in complete steps to schedule a sas program in unix ?

Accepted Solution Solved
Reply
Contributor
Posts: 46
Accepted Solution

Help in complete steps to schedule a sas program in unix ?

Hi,

 

I have a SAS program in my local machine to import data from an external source. I want to schedule the program to run after every 5 minutes. I have tried using SAS Management Console, but unsuccessful. So i have decided to schedule it in the sas server, which runs on UNIX environment. 

I have been said to create a execuatable of my program using the following command :
-> <path of SAS exe> -nodms <path of SAS Program on server> but all i got was "Command not found".

 

and after getting done schedule it using the corntab in UNIX server.

 

 

Please help me providing detail steps to do.

 

SAS Support Mumbai is unable to help, thats why i have turned to community for help.

 

Thnaks in advance.


Accepted Solutions
Solution
‎01-12-2017 03:53 AM
Super User
Posts: 7,805

Re: Help in complete steps to schedule a sas program in unix ?

Posted in reply to ankit___gupta

Once logged on to the commandline, enter

which sas

If that does not give you the absolute path to the SAS executable, then the directory of the SAS binary is not included in your PATH environment variable.

In this case, do this:

In SAS MC, open Server Manager, then your server context (most probably SASApp), then the Logical Workspace Server. Right-click on the Workspace Server beneath the Logical Workspace Server, and select Properties.

In Options, you will find the absolute path to the WorkspaceServer.sh shell script.

Go back to your commandline window.

One Step down in the path (eg /..../Lev1/SASApp) you will find a sas.sh shell script that can be used to start SAS in the same base context that your EG uses. In the Lev1 directory, you can find a file called level_env.sh that contains (among others) the definition of SASROOT and SAS_COMMAND, pointing to the SAS executable.

 

What did your <path of SAS exe> in the failed test look like?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Contributor
Posts: 52

Re: Help in complete steps to schedule a sas program in unix ?

Posted in reply to ankit___gupta

Crontab can be used to schedule jobs in Unix via Unix SAS. you can schedule in crontab without creating the executable as well. you can mention the physical path of your program to be run.

 

To access crontab login to Unix and type crontab -e (Edit mode). This is a VI Editor. Press Esc Key and I for insert. Press Esc Key and x to delete.

 

Syntax for crontab is

*    *    *    *    *  command to be executed

┬    ┬    ┬    ┬    ┬

│    │    │    │    │

│    │    │    │    │

│    │    │    │    └───── day of week (0 - 6) (Sunday=0 )

│    │    │    └────────── month (1 - 12)

│    │    └─────────────── day of month (1 - 31)

│    └──────────────────── hour (0 - 23)

└───────────────────────── min (0 - 59)

 

 

for example:

05 * * * 0-6 nohup  /SAS Installation Path/ /my progam/ss.sas

 

This would run the program every week day at after 5 mins .

 

 


Cheers from India!

Manjeet
Solution
‎01-12-2017 03:53 AM
Super User
Posts: 7,805

Re: Help in complete steps to schedule a sas program in unix ?

Posted in reply to ankit___gupta

Once logged on to the commandline, enter

which sas

If that does not give you the absolute path to the SAS executable, then the directory of the SAS binary is not included in your PATH environment variable.

In this case, do this:

In SAS MC, open Server Manager, then your server context (most probably SASApp), then the Logical Workspace Server. Right-click on the Workspace Server beneath the Logical Workspace Server, and select Properties.

In Options, you will find the absolute path to the WorkspaceServer.sh shell script.

Go back to your commandline window.

One Step down in the path (eg /..../Lev1/SASApp) you will find a sas.sh shell script that can be used to start SAS in the same base context that your EG uses. In the Lev1 directory, you can find a file called level_env.sh that contains (among others) the definition of SASROOT and SAS_COMMAND, pointing to the SAS executable.

 

What did your <path of SAS exe> in the failed test look like?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 315 views
  • 1 like
  • 3 in conversation