Scheduling SAS program with UNIX

Reply
Contributor
Posts: 25

Scheduling SAS program with UNIX

Hello all,

 

i'm trying to scheduling a SAS program with Cron in UNIX.

The SAS program run with 2 sub tasks for a parallel processing.

These sub tasks are basically two sessions with the autosignon and the SAS Grid.

I wrote also a .sh program to start the .sas program, set some option and the path for the log.

When I run the sh from the server there aren't problems and everything works correctly.

If I create a schedule in unix as crontab, the sas program starts correctly but the I cannot initialize the SAS GRID and open the two sessions for the parallel processing.

Why? I cannot understand the cause of this problem.

 

This is the message in the log file:

 

NOTE: Remote session ID Task1 will use the grid service _ALL_.

NOTE: Remote signon to Task1 commencing (SAS Release 9.04.01M4P110916).
ERROR: Cannot initialize the grid provider module.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot initialize the grid provider module.
ERROR: Remote signon to Task1 canceled.

Respected Advisor
Posts: 4,286

Re: Scheduling SAS program with UNIX

[ Edited ]

@AsSASsin

If you've got a SAS Grid then you've got LSF (which does all the load balancing on a SAS Grid). If you've got LSF then why are you using CRON instead of LSF?

Contributor
Posts: 25

Re: Scheduling SAS program with UNIX

The main sas program switch the workload in two asynchrone task using the grid.

I have to run the main program...that use the lsf to balance the jobs...right?

Super User
Posts: 8,590

Re: Scheduling SAS program with UNIX

[ Edited ]

What do you mean by

 

When I run the sh from the server

 

?

 

There has to be a difference between the two methods that causes your problem. Look for missing or wrongly set environment variables.

If you run a shell script from an already running SAS process by using X or similar, you inherit the environment from the SAS process, which has gotten it from it's own startup script (ie the WorkspaceServer.sh)

Starting Foundation SAS directly from a commandline will miss this environment, and that's what happens from cron.

 

And you also need to take care that the shell script for cron uses the same config and autoexec files that you employ when you succeed.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 25

Re: Scheduling SAS program with UNIX

Posted in reply to KurtBremser

The script .sh is on a shared folder on the cluster.

With a terminal connection(ssh) if I run the sh everything is ok.

If I have to schedule the shell sript every day with crontab (and with the same user) the grid initialization fails.

Super User
Posts: 5,626

Re: Scheduling SAS program with UNIX

LSF does scheduling as well as load balancing. So like @Patrick I'm in favour of using that instead of cron.
Data never sleeps
Contributor
Posts: 25

Re: Scheduling SAS program with UNIX

Ok how could I have to schedule with lsf? With the schedule manager?

if yes is there a way to avoid that log files are created in the default folder under config/levX?

Respected Advisor
Posts: 4,286

Re: Scheduling SAS program with UNIX

@AsSASsin


AsSASsin wrote:

Ok how could I have to schedule with lsf? With the schedule manager?

if yes is there a way to avoid that log files are created in the default folder under config/levX?


If you've got metadata deployment objects then yes, that would be the easiest way.

 

is there a way to avoid that log files are created in the default folder

Changing the defaults sounds like a good idea. Change the log directory path to whatever you like. 

If you have multiple projects/applications and you want different log directories then simply create a new server. That's a very simple process.

Capture.JPG

 

If you don't have SAS metadata deployment objects then you can still use LSF. As I understand it the LSF license that comes with SAS gives you access to the full LSF functionality with the only restriction that you can only schedule .sas files.

https://support.sas.com/rnd/scalability/platform/index.html 

 

Contributor
Posts: 25

Re: Scheduling SAS program with UNIX

Thank you for explanation.

I will try with the LSF to schedule my .sas .

I will notify you soon if it will work correctly.

 

Contributor
Posts: 25

Re: Scheduling SAS program with UNIX

Hello,

I solved the issue replacing in my sh script the path of the sas executable with the path of the script used in the default DATA step batch server (sasbatch.sh).

After I scheduled it with crontab without problems and now, without create anothere batch server from MC, I have scheduled my sas program (and I can choose the path of the log and pass sysparm values from the shell with no troubling). 

 

Thank you all for the support.

Respected Advisor
Posts: 4,286

Re: Scheduling SAS program with UNIX

[ Edited ]

@AsSASsin

That's certainly a way to go and may be the right thing to do for your needs.

Just be aware that crontab is seriously inferior to LSF and that you're missing out on a lot of functionality which would be available to you.

 

LFS allows for enterprise level scheduling wherelse crontab is on the level of the Windows Task Scheduler. It just allows for some simple level of automation.

Ask a Question
Discussion stats
  • 10 replies
  • 216 views
  • 4 likes
  • 4 in conversation