Page 1 of 1

Multiple Instance job

Posted: Thu May 18, 2017 8:42 am
by gayathrisivakumar
Hi All,

I have source query that needs to be run for multiple date values.There are 2 date fields that will keep changing.

I need to find certain accounts that changed since 2016-01-01 to 2017-05-31 now (When we enter June that becomes 2016-01-01 to 2017-06-30. So the date range changes every month)
My requirement is to execute the query first for 2016-01-01 to 2016-01-31, then second instance for 2016-02-01 to 2016-02-29, then March etc. So in a single run of the job multiple instances needs to be executed.How can I provide all these dates as multiple inputs?

Thanks

Posted: Thu May 18, 2017 9:34 am
by chulett
It only needs to be multi-instance is they all need to run at the same time. Your need sounds like a Sequence job looping a normal job to me.

Posted: Thu May 18, 2017 10:26 am
by UCDI
you could do it either way... you could make it multi-instance and fire it off N times with N different parameters. You could loop. The loop sounds like the right way to go here, but both would work if you had a good reason to do one or the other design. Multi instance gets into problems with writing to the same target in parallel (locks, etc) for a task like this one. Where MI seems to shine is a totally reusable job that has varying targets and sources.

Posted: Thu May 18, 2017 11:14 am
by PaulVL
Since you are interacting with a database, you also need to understand the impact you will have there. Not knowing the complexity of the SQL you are performing we can't say if running them at the same time is prudent. Assuming you at some point you would be running 12 iterations of the job.

I would vote to run them sequentially just because of the database factor.

Posted: Thu May 18, 2017 2:02 pm
by FranklinE
Even if running sequentially in a loop, multi-instance makes sense for the invocation id. I have a job that runs the same Px for ftp mutlitple times, reading a list for each subsequent file name. Reading the log in Director is very much easier because I label each run in the invocation id with the numeric instance of the loop.