Desktop productivity for business analysts and programmers

Scheduling job to run based on availability of data

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Scheduling job to run based on availability of data

Hi there,

I will be taking some extended leave shortly and would like to automate my programs to run while I'm not there. My investigations bring me to setting up a schedule to have them run automatically. However, I want certain programs to only run if there is new data available that needs to be imported - this will be identified by a new file appearing in a specific folder SAS has access to. Is this possible? Also, does my pc need to be turned on and SAS open for the scheduler to run, or can this be set up on the server?

ETA - I want the scheduler to check if there is new data to be imported, if yes, then run the program to append the new data to the existing dataset, then delete the raw data file (the imported file). If there is no file containing new data, then there is nothing for the scheduler to do. I hope that makes sense!

Thanks,

Dearnne


Accepted Solutions
Solution
‎07-20-2015 10:06 PM
Respected Advisor
Posts: 3,063

Re: Scheduling job to run based on availability of data

Server-based scheduling is far more reliable than PC-based, so this is what I would recommend. If you have the SAS LSF scheduler available to you then you can set up the scheduling via SAS Management Console. LSF can be scheduled on the basis of a new file event - it does the checking for you so you don't have to code for it.

If you use your PC then it must be powered on and your userid must have a current password. The Windows scheduler can be used but it doesn't handle file events and you have to set up your batch jobs manually. You can write SAS code to check for file events, but then you would have to run your batch jobs more frequently just to check if a new file had arrived or not. This is not a reliable solution as all it would take is a power outage or someone to shut down your PC down and your scheduled jobs would not run. 

View solution in original post


All Replies
Solution
‎07-20-2015 10:06 PM
Respected Advisor
Posts: 3,063

Re: Scheduling job to run based on availability of data

Server-based scheduling is far more reliable than PC-based, so this is what I would recommend. If you have the SAS LSF scheduler available to you then you can set up the scheduling via SAS Management Console. LSF can be scheduled on the basis of a new file event - it does the checking for you so you don't have to code for it.

If you use your PC then it must be powered on and your userid must have a current password. The Windows scheduler can be used but it doesn't handle file events and you have to set up your batch jobs manually. You can write SAS code to check for file events, but then you would have to run your batch jobs more frequently just to check if a new file had arrived or not. This is not a reliable solution as all it would take is a power outage or someone to shut down your PC down and your scheduled jobs would not run. 

Occasional Contributor
Posts: 15

Re: Scheduling job to run based on availability of data

Thanks - sounds like LSF scheduler via the Management Console will do exactly what I need it to do. Unfortunately I can't set anything up using Windows Scheduler as my PC won't be turned on or logged in for a few months while I'm away.

I've checked the Management Console but can't find any reference to the scheduler. Would it be as simple as contacting my administrator to ask them to "activate' this for me?

Thanks,

Respected Advisor
Posts: 3,063

Re: Scheduling job to run based on availability of data

That is entirely possible. If your userid does not have SAS admin rights set up in SAS metadata, then you may not even see Schedule Manager as an option - this should appear in the SMC Explorer.

☑ This topic is SOLVED.

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

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