BookmarkSubscribeRSS Feed
SAS_1001
Obsidian | Level 7

Hello,

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.

Regards,

Paul

17 REPLIES 17
LinusH
Tourmaline | Level 20

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.

Data never sleeps
Quentin
Super User

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.

phew.

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.

-Q.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SAS_1001
Obsidian | Level 7

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.

Regards,

-P

Quentin
Super User

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.

See eg:

https://platformadmin.com/blogs/paul/2011/06/noxcmd/

Can beg your admin to turn it off, or look for a solution that doesn't rely on OS commands.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SAS_1001
Obsidian | Level 7

Which admin (SAS or Windows).  Where he has to turned this option off ?

Thanks for the input .

Quentin
Super User

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:

http://blogs.sas.com/content/sasdummy/2012/08/31/the-case-for-xcmd-privileges-in-sas-enterprise-guid...

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SAS_1001
Obsidian | Level 7

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 !

-P

Quentin
Super User

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.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SAS_1001
Obsidian | Level 7

The value is being shown here is after running the above %put statement:

XCMD

How can I change to noxcmd ?

SAS_1001
Obsidian | Level 7

Quenten,

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 ?

Quentin
Super User

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)

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SAS_1001
Obsidian | Level 7

That's the issue.  When I'm running through lsf I see the following in the log:

22         %put %sysfunc(getoption(XCMD)) ;

NOXCMD

How can I turn it to XCMD ?  Pl. advise !  I guess this is the problem that I've been experiencing !

LinusH
Tourmaline | Level 20

Add -xcmd in the \Config\Lev1\SASApp\BatchServer\sasv9_usermods.cfg file.

Data never sleeps
SAS_1001
Obsidian | Level 7

Thanks LinusH,

Do I need to bounch the servers ?  I ran the code after modifying sasv9_usermods.cfg but still seeing

NOXCMD !

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 17 replies
  • 3834 views
  • 0 likes
  • 4 in conversation