BookmarkSubscribeRSS Feed
SAPPER
Calcite | Level 5
Hello,
I am looking for a way to schedule(Trigger) a SAS job based on the availability of a table on the SQL server.
The table on the SQL server is created every night and we donot want to wait until a predefined time everynight.
Can we trigger the SAS job right after the table is created on the SQL server?
we donot have a SAS CONNECT license.
The SQL server job that creates the table is scheduled using SQL-Scheduler and we schedule the SAS jobs using "Active Batch" (3rd party tool).

Is there a way where SAS can "look" to the SQL server and determine if the table is created "new"?(like checking every 5 minutes after a predefined time??)
Any suggestions/comments are appreciated.

Thanks
-SAPPER
9 REPLIES 9
sfsdtegsdsdgdffhgfh
Fluorite | Level 6
you can create trigger file at the end of the job that creates sql table and look for the trigger file to kick off sas job.
SAPPER
Calcite | Level 5
Let me understand this in a correct way.
You are asking me to create a file on SQL server and ask SAS server to read this trigger file on SQL server?

Do you have any documentation/notes on how to do this?
-Thanks
SAPPER
Patrick
Opal | Level 21
Hi

I think what sastech is telling you is that the scheduler used for the sql server jobs should create a trigger file (some empty file with a given name) and put this trigger file to a place where he scheduler used for the SAS jobs is looking for (some listener process).

These are things one could expect schedulers are able to do.

Alternatively: I assume your SAS job should read this new DB table - meaning you've got SAS\Access installed. The SAS process could of course query some sytem table and wait for a current table creation/modification date. If the condition is not satisfied then wait whatever minutes and try later. This second approach would only be a workaround. Things like scheduling and dependencies should be managed by schedulers.

HTH
Patrick
SAPPER
Calcite | Level 5
Hello Patrick,
Thanks for the update.
We have SAS Access at our site.
The problem is making the two Schedulers "Talk" with each other.
The SQL job is scheduled using the SQL scheduler and SAS jobs are kicked off using a 3rd part Scheduler (ActiveBatch).
I will try to go through the documentation of both the Schedulers.
Just wanted to see if anybody out there was doing this.
-Thanks
Sapper
Patrick
Opal | Level 21
Hi

Yes, I've seen this in more than one project.

A process maintained with one scheduler creates staging files (text based data extracts) and then on the "SAS" side another scheduler is waiting for these files (listener) and kicks of SAS processes as soon as defined conditions are met.

i.e. Seen with TIDAL and LSF, Control-M and Autosys

The first scheduler creating marker files for which the second scheduler is waiting for is the way people often implement processes which use more than one scheduler.

HTH
Patrick
Jehan
Calcite | Level 5

Hi Patrick/ALL,

I am working on scheduling a SAS job in Autosys. My client is saying they need their tasks such access to stored procedures. Had anyone of you experienced it via Autosys?

SASKiwi
PROC Star

SAS can run SQL Server stored procedures regardless of how the SAS job is scheduled or run.

Jehan
Calcite | Level 5

This is what I want to understand.. how I can call that SAS job via Autosys. Is there any back-end instead of just seeing the GUI alone?

sfsdtegsdsdgdffhgfh
Fluorite | Level 6
Patrick thanks for explanation. Sapper hope it works for you.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 5860 views
  • 0 likes
  • 5 in conversation