04-22-2014 10:20 AM
I'd like to schedula a SAS program in lsf, could you pl. guide me thorugh the process start-2-end. Let's say I'd like to deploy a SAS job abc.sas in lsf through process manager. How can I do that.
Thanks & appreciated.
04-23-2014 07:26 AM
I think that the general idea of integrating LSF and SAS, is to use the interfaces between those products. Which means that scheduling of jobs and flows are done via the Schedule Manager plugin in Managment Console.
How to do it this way, there is a pretty straight forward description in the on line documentation.
There are also some papers in the subject, just search support.sas.com.
04-23-2014 12:08 PM
Gotta say, I still don't find the scheduling process to be straight forward. At least not if you're an old-school batch job SAS programmer, used to just scheduling batch jobs via cron.
I think this the relevant doc for 9.3 is: http://support.sas.com/documentation/cdl/en/scheduleug/64110/HTML/default/viewer.htm#titlepage.htm
Once I have a .sas file ready for scheduling as a batch job, here are the hoops I job through. Which I post in full hope that someone will point out how bad my process is. : )
1. In DI Studio I create a DI job which includes a single node of user-generated code. That code is an %INCLUDE statement which %includes my .sas program.
2. In DIS I deploy the job for scheduling.
3. In SAS Management Console Schedule Manager I create a flow which consists of the deployed job.
4. In SMC I schedule the flow.
Surely feels like there should be an easier way to say "Hey SAS Server, please run this .sas file daily at midnight." And likely there is.
Of course there are benefits to having job info in the metadata, even if the end the job is simply a simple command to batch submit a program.
If you get into scheduling with LSF, one great tip I picked up at NESUG (sigh) a couple years back is to install Flow Manager. Flow Manager is an LSF app, but SAS provides a stripped down version of it. It's proved very helpful to see what jobs are scheduled, which are running, history, etc. Particularly in a few of cases where I swear I unscheduled a flow (using SMC) and deleted the flow, but somehow it remained scheduled on the LSF side. Deleting the flow via Flow Manager did the trick.
04-23-2014 01:18 PM
Thanks for the response. I was able to schedule a job in LSF but getting the following error. When running outside lsf thorugh EG or Base SAS, not getting these errors.
ERROR: Insufficient authorization to access PIPE.
ERROR: Error in the FILENAME statement.
Any advise would be greatly helpful.
04-23-2014 02:04 PM
You get that error somewhere in your SAS code where you are trying to pipe OS commands, right?
Most likely NOXCMD is turned on for your batch server.
Can beg your admin to turn it off, or look for a solution that doesn't rely on OS commands.
04-23-2014 08:04 PM
SAS Admin. XCMD is an option that needs to be turned on in the config file for the batch server. LinusH gave the location of the default config file. If you have write access to that (would be surprising if you're not the SAS Admin), give it a shot. Conceivable that you would need to bounce the server. Regardless, whoever administers your SAS server should know how to set such SAS options. So I will stick with my earlier recommendation, call your SAS admin and say "pretty please can you turn on XCMD for the batch server?"
And if they say no (because they are mean, or because they don't understand how to turn it on while keeping stuff secure), then look at your code and see if you can change it to get the same result (you haven't told us *why* you're piping OS commands), with native SAS code. In fact, many folks would say even if XCMD is enabled, there are benefits to getting you job done with SAS code (portability etc).
Chris H has a nice post about XCMD:
04-23-2014 03:00 PM
Thanks for the response.
For some jobs, they are running fine, but some jobs they are failing due to this pipe error ? Do you think we need to assign any option the programs ?
Appreciaed feedback !
04-23-2014 03:04 PM
Maybe show more of the log from when you get this error.
If the issue is NOXCMD, it will be either on or off for the batch server used for scheduled jobs. So can't change this by setting an option in the program.
%put %sysfunc(getoption(XCMD)) ; should show the value of the option.
04-23-2014 04:00 PM
I'm scheduling the jobs through schedule manager and checking the flow from process manager. Jobs are running good in EG but in process manager, they get stuck up. No idea whats going on ?
04-23-2014 04:10 PM
XCMD is what you want.
Did you run the %PUT statement in the job you scheduled? Scheduled jobs run on a different server (batch server) than code that you run in EG. So it's possilbe XCMD is allowed on the server where your EG session runs, but not on the batch server.
You have a SAS log file from the scheduled job that shows an error, right? Suggest you show that log. (key parts)
04-23-2014 05:04 PM
That's the issue. When I'm running through lsf I see the following in the log:
22 %put %sysfunc(getoption(XCMD)) ;
How can I turn it to XCMD ? Pl. advise ! I guess this is the problem that I've been experiencing !