compilation or reset

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
toussaintmtt
Participant
Posts: 10
Joined: Fri Apr 01, 2005 6:59 am

compilation or reset

Post by toussaintmtt »

How can we do to compile all jobs ( i have script to compile jobs that not compiled, but i want compiled instances ( of job because the job is in compiled status and instances are finished).

I want reset job (that makes but status is compiles) can i have another status.
i use :

SUBR = DSR.SUB.JOB

Key = DSR.SUB.JOB.COMPILE
Arg2 = Job
Call @SUBR(Key, Arg2)
If Key <> "" Or Arg2<1> <> "" Then
WarnMsg = DSRMessage("", "Problems compiling job '%1'", JobName):@FM:Key:@FM:Arg2
Call DSLogWarn(Lower(WarnMsg), LOG.WARN.NAME)
End
Else
* Clear the RT_STATUS and RT_LOG files
JobNo = DSRGetJob(Job,0)
Execute "CLEAR.FILE ":DSR.RTSTATUS.FNAME:JobNo
Execute "CLEAR.FILE ":DSR.RTLOG.FNAME:JobNo
End
Key = DSR.SUB.JOB.RELEASE
Arg2 = JobName
Call @SUBR(Key, Arg2)
GoTo suite

thanks for response to change status and compile all jobs
sachinkc
Participant
Posts: 34
Joined: Sat Apr 17, 2004 11:39 am
Location: USA

Re: compilation or reset

Post by sachinkc »

You can use dsjob from OS console to do a RESET of the jobs so that they are in runnable state, but I'm not sure about compiling them from OS (without writing heavy code).

Haven't done that through a routine yet, so can't answer that one for you.


- Sachin
toussaintmtt wrote:How can we do to compile all jobs ( i have script to compile jobs that not compiled, but i want compiled instances ( of job because the job is in compiled status and instances are finished).

I want reset job (that makes but status is compiles) can i have another status.
i use :

SUBR = DSR.SUB.JOB

Key = DSR.SUB.JOB.COMPILE
Arg2 = Job
Call @SUBR(Key, Arg2)
If Key <> "" Or Arg2<1> <> "" Then
WarnMsg = DSRMessage("", "Problems compiling job '%1'", JobName):@FM:Key:@FM:Arg2
Call DSLogWarn(Lower(WarnMsg), LOG.WARN.NAME)
End
Else
* Clear the RT_STATUS and RT_LOG files
JobNo = DSRGetJob(Job,0)
Execute "CLEAR.FILE ":DSR.RTSTATUS.FNAME:JobNo
Execute "CLEAR.FILE ":DSR.RTLOG.FNAME:JobNo
End
Key = DSR.SUB.JOB.RELEASE
Arg2 = JobName
Call @SUBR(Key, Arg2)
GoTo suite

thanks for response to change status and compile all jobs
Rgrds & Cheers!

Sachin
sachin@operamail.com
~Life always finds a way~
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

That looks like part of compile routine I posted. It is incomplete. If you try to compile jobs that are running then you can have problems. If you clear RT_STATUS files while jobs are running then this also is not good. The jobs continue to run in the background and are no longer talking to the DataStage server. These jobs tend to get confused and may do strange things. I know the Director is slow when there are lots of instances out there but this is a poor solution. I would bet your DataStage server is unstable and performs poorly.

If you use these routines then you need to understand what you are doing. The compile all program DSX used to give away and the routine I posted and others versions like Ray and Ken posted were not to be used during production runs. On older versions of DataStage when you imported the jobs then it would not automatically compile the jobs. This has been fixed. Please stop what you are doing and upgrade to Ds7.5.1. All these problems have been fixed.

Ray also posted routines to clear the log file properly. It is not a good idea to do a CLEAR.FILE on RT_LOG or RT_STATUS files. When you do it improperly then you orphan running jobs. This is not good.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D

You can download CompileAll from the sister site to DSXChange.

Once you upgrade to version 7, this functionality is inside the product, called Multiple Job Compile.

If you really want to code it yourself, I'd suggest using server side tracing to trace what a "real" compile does, and adapt those routine calls to your own purposes; not something I'd really advise for a beginner! Particularly since you're posting in the parallel forum; there are many things that must be set up correctly to compile parallel jobs.

And, please, do heed Kim's advise in the preceding post about dangers of clearing run-time repository tables inappropriately. If you can compile jobs properly their status will change to Compiled.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply