Page 1 of 1

Schedule Compiling batch script

Posted: Tue Jun 16, 2009 1:46 pm
by Lotus26
Hi All

I have a requirement of , create a script which will scan through all the set of jobs and then compiles if there are any jobs with "Not Compiled" State . Can anybody help me in this .

I would really appreciate your time and help on this.

Posted: Tue Jun 16, 2009 2:24 pm
by chulett
Seems like a strange requirement, why would you need to do such a thing? :?

Not sure how simple this would be, regardless. Normally I'd say do this with "dsjob": first with "-ljobs" to get their names and then iterate thru the names using "-jobinfo" to see what state each one is in. Problem is, jobs in a "Not Compiled" state cannot be found by the "-jobinfo" option, you get an error instead. Hmmm... unless you assume that the:

ERROR: Failed to open job
Status code = -1004

messages it logs in that case can be assumed to mean a job in that status. After that, use dscc.exe to compile them.

All from the client side.

Posted: Tue Jun 16, 2009 3:40 pm
by nagarjuna
This can be done only on client machine .Because you want all the jobs in uncompiled state to be compiled through script .

Use : -jobstatus in tandem with dscc .

Posted: Tue Jun 16, 2009 3:41 pm
by nagarjuna
Also ...dsjob -ljobs as mentioned by craig

Posted: Tue Jun 16, 2009 4:21 pm
by ray.wurlod
Even easier is this approach. Use the Multiple Job Compile tool and check the "select only uncompiled jobs" check box.

Posted: Tue Jun 16, 2009 4:21 pm
by chulett
nagarjuna wrote:Use : -jobstatus in tandem with dscc .
Small correction: "-jobinfo" as there is no "-jobstatus" option. :wink:

Posted: Tue Jun 16, 2009 4:23 pm
by chulett
ray.wurlod wrote:Even easier is this approach. Use the Multiple Job Compile tool and check the "select only uncompiled jobs" check box.
True... except for the apparent need to schedule this so as to run unattended.

Posted: Tue Jun 16, 2009 4:32 pm
by ray.wurlod
How often do you need to check for uncompiled jobs?

There's only one way they can become uncompiled, and there's always a person present when that happens.

Posted: Tue Jun 16, 2009 4:34 pm
by chulett
I know, which is why I asked why one would 'need' such a thing. :?

Posted: Wed Jun 17, 2009 10:38 am
by Lotus26
Thank you for all your responses .

we got this requirement because in our environment , by mistake some of the other people migrating the jobs but forgetting to compile and because of which we are getting problems .

To avoid that situation , we want to create a script which will scan through all the jobs and want to compile the jobs which are not in the compiled or runnable state.

Posted: Wed Jun 17, 2009 10:59 am
by nagarjuna
Then while exporting use the option with executables ..

Posted: Wed Jun 17, 2009 11:03 am
by chulett
Or use Version Control to automate the process! :wink: