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
Posts: 189 Joined: Thu Oct 12, 2006 12:08 am
Post
by ady » Fri Mar 09, 2007 12:16 pm
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
Posts: 189 Joined: Thu Oct 12, 2006 12:08 am
Post
by ady » Fri Mar 09, 2007 12:21 pm
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 » Fri Mar 09, 2007 12:29 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Mar 09, 2007 1:13 pm
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 » Fri Mar 09, 2007 1:20 pm
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....
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Mar 09, 2007 1:26 pm
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
Posts: 6854 Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX
Post
by DSguru2B » Fri Mar 09, 2007 1:26 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Mar 09, 2007 1:28 pm
DSguru2B wrote: In the constraints, scroll right, you should be able to see 'Abort After' column.
Fixed that for ya.
-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 » Fri Mar 09, 2007 1:41 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Mar 09, 2007 1:52 pm
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
Posts: 6854 Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX
Post
by DSguru2B » Fri Mar 09, 2007 2:00 pm
chulett wrote: DSguru2B wrote: In the constraints, scroll right, you should be able to see 'Abort After' column.
Fixed that for ya.
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 » Fri Mar 09, 2007 2:12 pm
DHANYAVAD SIRJI :D
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
DSguru2B
Charter Member
Posts: 6854 Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX
Post
by DSguru2B » Fri Mar 09, 2007 2:22 pm
ganesh123 wrote: DHANYAVAD SIRJI :D
...means, "Thank You Sir" with respect
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Mar 09, 2007 3:01 pm
De nada.
-craig
"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Sat Mar 10, 2007 2:29 am
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'