Constraint to abort job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Constraint to abort job

Post 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
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

The condition is col1 = col2


ie: if col1 <> col2 then ABORT JOB
ganesh123
Participant
Posts: 70
Joined: Tue Feb 20, 2007 3:22 pm
Location: NJ,USA
Contact:

Post 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
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't need to do anything 'special' - just set the Abort After Rows value to 1 in the Reject link constraint.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ganesh123
Participant
Posts: 70
Joined: Tue Feb 20, 2007 3:22 pm
Location: NJ,USA
Contact:

Post 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.... :roll:
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DSguru2B wrote:In the constraints, scroll right, you should be able to see 'Abort After' column.
Fixed that for ya. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ganesh123
Participant
Posts: 70
Joined: Tue Feb 20, 2007 3:22 pm
Location: NJ,USA
Contact:

Post 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?
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Something like that or a call to DSGetLinkInfo using the DSJ.LINKROWCOUNT InfoType. And you could call either UtilityAbortToLog or DSLogFatal.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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:
Thanks Craig.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ganesh123
Participant
Posts: 70
Joined: Tue Feb 20, 2007 3:22 pm
Location: NJ,USA
Contact:

Post by ganesh123 »

DHANYAVAD SIRJI :D
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

ganesh123 wrote:DHANYAVAD SIRJI :D
...means, "Thank You Sir" with respect :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

De nada. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply