Schedule Compiling batch script

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Lotus26
Premium Member
Premium Member
Posts: 48
Joined: Tue Jul 13, 2004 2:09 pm

Schedule Compiling batch script

Post 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.
Regards
Lotus26
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post 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 .
Nag
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Also ...dsjob -ljobs as mentioned by craig
Nag
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Even easier is this approach. Use the Multiple Job Compile tool and check the "select only uncompiled jobs" check box.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

nagarjuna wrote:Use : -jobstatus in tandem with dscc .
Small correction: "-jobinfo" as there is no "-jobstatus" option. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I know, which is why I asked why one would 'need' such a thing. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Lotus26
Premium Member
Premium Member
Posts: 48
Joined: Tue Jul 13, 2004 2:09 pm

Post 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.
Regards
Lotus26
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Then while exporting use the option with executables ..
Nag
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or use Version Control to automate the process! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply