Page 1 of 2
Constraint to abort job
Posted: Fri Mar 09, 2007 12:16 pm
by ady
Hi,
I am working on a job in which there is a condition, Which if not satisfied should abort the job. Can I do this ?
I have this job in a sequence, so when the job fails ....the "fatal" link should be executed.
Please help .. thnx
Posted: Fri Mar 09, 2007 12:21 pm
by ady
The condition is col1 = col2
ie: if col1 <> col2 then ABORT JOB
Posted: Fri Mar 09, 2007 12:29 pm
by ganesh123
Use a reject link in your job going to a Seq file. If data comes in Seq file abort job using UtilityAbortToLog(%AbortMessage%) in TX
Posted: Fri Mar 09, 2007 1:13 pm
by chulett
You don't need to do anything 'special' - just set the Abort After Rows value to 1 in the Reject link constraint.
Posted: Fri Mar 09, 2007 1:20 pm
by ganesh123
Craig is there any option that if we want to collect all the rejected rows in a separate file and then do ABORT later after collecting all rows ?
In this way we can know how many and which rows are bad....
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Posted: Fri Mar 09, 2007 1:26 pm
by chulett
Sure, that's a different requirement. I'd setup something 'after job', a routine that checks the row count down your reject link, let's say, and then aborts the job if the count is non-zero.
Posted: Fri Mar 09, 2007 1:26 pm
by DSguru2B
In the stage variables, scroll right , you should be able to see 'Abort After' column. If you dont have that, then you can utilize UtilityAbortToLog() as others have noted.
Posted: Fri Mar 09, 2007 1:28 pm
by chulett
DSguru2B wrote:In the constraints, scroll right, you should be able to see 'Abort After' column.
Fixed that for ya.
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Fri Mar 09, 2007 1:41 pm
by ganesh123
I guess I am not hacking the topic
So Craig something like this in Shell script ?
Code: Select all
count= wc -l bad.file
if ($count>0)
then
ABORT
else
continue
fi
Which utility or function of DS has to be called in ABORT in above code?
Posted: Fri Mar 09, 2007 1:52 pm
by chulett
Something like that or a call to DSGetLinkInfo using the DSJ.LINKROWCOUNT InfoType. And you could call either UtilityAbortToLog or DSLogFatal.
Posted: Fri Mar 09, 2007 2:00 pm
by DSguru2B
chulett wrote:DSguru2B wrote:In the constraints, scroll right, you should be able to see 'Abort After' column.
Fixed that for ya.
![Wink :wink:](./images/smilies/icon_wink.gif)
Thanks Craig.
Posted: Fri Mar 09, 2007 2:12 pm
by ganesh123
DHANYAVAD SIRJI :D
Posted: Fri Mar 09, 2007 2:22 pm
by DSguru2B
ganesh123 wrote:DHANYAVAD SIRJI :D
...means, "Thank You Sir" with respect
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Fri Mar 09, 2007 3:01 pm
by chulett
De nada.
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Sat Mar 10, 2007 2:29 am
by kumar_s