SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Run a subjob triggering by a file event

Reply
Contributor
Posts: 38

Run a subjob triggering by a file event

Hello everyone, 

 

Here is a job(main_job)  which include a file event and a subjob as follow.

delete.png 

  1. I want to run the main_job seconds by seconds, which means the job is always running without exiting.
  2. Then I want to trigger the testFileEvent job to be ran by modifying the file, which means the testFileEvent job will run when the file in the file event is edited. Every time when I click "save" to save the file, then the testFileEvent job runs.

Thankyou

Contributor
Posts: 33

Re: Run a subjob triggering by a file event

Are you talking about a program started in SAS Studio? 

 

You can create an infinite loop checking the file modification time and trigger another program as soon as a modification is recognized. 

 

I don't know how to setup such a process with the jobs defined in metadata.

Contributor
Posts: 38

Re: Run a subjob triggering by a file event

I am doing it in sas management console

Community Manager
Posts: 552

Re: Run a subjob triggering by a file event

[ Edited ]

Hi @R_Chung, are you using DI Studio? An internal expert here at SAS is asking. If so, it may make sense to move this thread over to the Data Management Community, where more of your peers are equipped to answer. Thanks, @LinusH and @error_prone, for helping clarify the question!

Contributor
Posts: 38

Re: Run a subjob triggering by a file event

I have no idea how to implement in either SMC or DI or both
Super User
Posts: 5,257

Re: Run a subjob triggering by a file event

A subjob is not a concept of SMC Scheduling Manager. You can define outer/inner jobs in DI Studio. What does your main job actually do?
File events is ASFAIK available only for Platform LSF, do you have that?
Data never sleeps
Super User
Posts: 5,257

Re: Run a subjob triggering by a file event

Ok, but to be able to get any relevant feedback start by answering my questions.
Perhaps describe the overall application and requirements.
If you don't even where to start I think you might need some on site support.
Data never sleeps
Contributor
Posts: 38

Re: Run a subjob triggering by a file event

@LinusH
In high level description, when there is any modification from a file, this action should trigger a job to start.

e.g.
file a
job b

when I edit file a and save it
this action will trigger job b to run
Super User
Posts: 5,257

Re: Run a subjob triggering by a file event

So, again, if you have Platform LSF I think there is a file event for modifications (I don't have access to SAS nor LSF at this point to verify).
Otherwise you probably need to develop a scripts of some sort to do this. If you have another scheduling tool at your site talk to the maintenance team for that, they should be able to help you.
Either way, no need for a main job. Just create the jobs you see fit, and leave the event handling to the scheduler. In case of a non SAS supported schedule, still create the job flow in SMC Scheduling Manager, and deploy it for manual execution. Then an OS script is created that can be called by the schedule of your choice.
Data never sleeps
Contributor
Posts: 38

Re: Run a subjob triggering by a file event

thanks and let me check in LSF
Ask a Question
Discussion stats
  • 9 replies
  • 284 views
  • 1 like
  • 4 in conversation