Page 1 of 1

Detect if a job is multi-instance?

Posted: Fri Oct 28, 2011 9:49 am
by SettValleyConsulting
Is it possible to detect if a job is multi-instance in code?

I have a shared container and it generates a string based on the Job Name and Invocation ID. But when embedded in a single-instance job the call to the DSInvocationID macro throws a warning.

We have a zero-tolerance policy towards warnings, so I was wondering if it is possible to test if the host job is Single Instance and not do the macro call if so?

I could of course make 2 versions of the SC, or demote the warning to Info, just wondering if there was a more elegant answer .....

Posted: Fri Oct 28, 2011 9:52 am
by ray.wurlod
The easiest non-warning way is a routine that uses the DSGetJobInfo() function. One of the returnable values is a true/false indicating whether or not the job is multi-instance capable.