Routine to compile a job
Moderators: chulett, rschirm, roy
Routine to compile a job
Hello,
I am new to DS Server and I would like to know if it exists a routine only to compile a job ?
something like the routine UtilityRunJob but just to compile (I can't validate it because of 'dynamic' parameters (with sql))
to explain: my problem is that i run many times (in a sequence) a job which runs others jobs without compiling. But when it aborts once, all the next call abort because it is not in a right state.
Somebody could help me?
thanks for your help
I am new to DS Server and I would like to know if it exists a routine only to compile a job ?
something like the routine UtilityRunJob but just to compile (I can't validate it because of 'dynamic' parameters (with sql))
to explain: my problem is that i run many times (in a sequence) a job which runs others jobs without compiling. But when it aborts once, all the next call abort because it is not in a right state.
Somebody could help me?
thanks for your help
Re: Routine to compile a job
When you call a job from a sequence through the job activity, their is an option in the job activity Execution Action, whose value is set to Run default, change it to Reset if required, then run. This should solve your requirement.
Thanks
Thanks
Success consists of getting up just one more time than you fall.
I think I don't have well explained it.
I must use a job which calls others jobs with the routine
UtilityRunJob(jobname, jobparameters, row limit, warning limit)
but this routine doesn't do 'the reset if required then run' so it couldn't run the jobs in aborted state.
I would like (if i can ) use a routine to compile this job jobname before?
ps:this job is very complex and i wouldn't have to transform it into a sequence.
I must use a job which calls others jobs with the routine
UtilityRunJob(jobname, jobparameters, row limit, warning limit)
but this routine doesn't do 'the reset if required then run' so it couldn't run the jobs in aborted state.
I would like (if i can ) use a routine to compile this job jobname before?
ps:this job is very complex and i wouldn't have to transform it into a sequence.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You don't need to recompile a routine in order to make it running from a job or a sequence. If you have issued a call to DSAttachJob() somewhere in your process then you can issue a command and it will reset an aborted job prior to running.
Code: Select all
JobHandle = DSPrepareJob(JobHandle)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 232
- Joined: Fri Sep 30, 2005 4:52 am
- Contact:
thanks very much :D
now it is ok! I've created a small routine for it, which reset if necessary.
now it is ok! I've created a small routine for it, which reset if necessary.
Code: Select all
*************************************************************************
* Copyright (C) 2004, 1997-2003 Ascential Software Corporation. ALL Rights Reserved. *
* This code may be copied ON condition that this copyright *
* notice IS included AS IS IN ANY code derived FROM this source. *
*************************************************************************
*
* Demonstrate how TO RESET a job within the GUI development enviroment.
*
$INCLUDE DSINCLUDE JOBCONTROL.H
Equate RunJobName TO Arg1
JobHandle = ''
Info = ''
ErrCode='No reset required'
JobHandle = DSAttachJob(RunJobName, DSJ.ERRFATAL)
* Call DSLogInfo(Message, RoutineName)
* LimitErr = DSSetJobLimit(JobHandle, DSJ.LIMITROWS, RowLimit)
* LimitErr = DSSetJobLimit(JobHandle, DSJ.LIMITWARN, WarnLimit)
* get status
Status = DSGetJobInfo(JobHandle, DSJ.JOBSTATUS)
IF (Status = DSJS.RUNFAILED OR Status = DSJS.RUNWARN) THEN
ErrCode = DSRunJob(JobHandle, DSJ.RUNRESET)
ErrCode = DSWaitForJob(JobHandle)
Call DSLogWarn(Message, RoutineName)
END
Ans=ErrCode
Good start. A couple of points, qualified by the fact that this is all off the top of my head.
1) No need to reset for a RUNWARN. Probably better to check for the ones you don't need to reset and do it for any other code. Jobs do fail in more ways than just by Aborting, ya know.
2) You should check to see if the DSAttachJob succeeded.
3) Why log a warning when resetting?
4) Where is 'Message' defined? 'RoutineName'? I don't recall the 'routine name' being set automagically. Where is 'Info' used?
5) Once complete, use DSDetachJob to release the handle.
1) No need to reset for a RUNWARN. Probably better to check for the ones you don't need to reset and do it for any other code. Jobs do fail in more ways than just by Aborting, ya know.
2) You should check to see if the DSAttachJob succeeded.
3) Why log a warning when resetting?
4) Where is 'Message' defined? 'RoutineName'? I don't recall the 'routine name' being set automagically. Where is 'Info' used?
5) Once complete, use DSDetachJob to release the handle.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers