BookmarkSubscribeRSS Feed
AsSASsin
Quartz | Level 8

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.

10 REPLIES 10
Patrick
Opal | Level 21

@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?

AsSASsin
Quartz | Level 8

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?

Kurt_Bremser
Super User

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.

AsSASsin
Quartz | Level 8

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.

LinusH
Tourmaline | Level 20
LSF does scheduling as well as load balancing. So like @Patrick I'm in favour of using that instead of cron.
Data never sleeps
AsSASsin
Quartz | Level 8

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?

Patrick
Opal | Level 21

@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 

 

AsSASsin
Quartz | Level 8

Thank you for explanation.

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

I will notify you soon if it will work correctly.

 

AsSASsin
Quartz | Level 8

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.

Patrick
Opal | Level 21

@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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1749 views
  • 4 likes
  • 4 in conversation