How to abort job based on constraint

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

chalasaniamith
Participant
Posts: 36
Joined: Wed Feb 16, 2005 5:20 pm
Location: IL

How to abort job based on constraint

Post by chalasaniamith »

I know its not a good practise to abort job.
But based on requirment i need to abort job based on a condition in Transformer.Is there any way to do it.I searched in form i didnt get the needed information So any one can help on this ?
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

You can always use the Abort After Rows option in the Transformer to achieve this. The only catch being that you cannot pass a parameter to this option.

If you can shed some more light on your requirement and the constarint given, someone can suggest a solution.

Aneesh
chalasaniamith
Participant
Posts: 36
Joined: Wed Feb 16, 2005 5:20 pm
Location: IL

Post by chalasaniamith »

thnaks i will try this one.If you dont pass the parameter does the job abort? that what your saying right?
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's impossible not to pass a parameter. If you don't give it an explicit value it will take its default value. If its default value is illegal (for example "" for a date parameter), the job won't even start.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

chalasaniamith wrote:If you dont pass the parameter does the job abort? that what your saying right?
If you want the job to abort after encountering 5 rows that does not satisfy the constraint - then you would have to hard code 5 in the Abort After Rows option.

What I meant is that you cannot pass 5 as a parameter to that option.

Hope this helped.

Aneesh
chalasaniamith
Participant
Posts: 36
Joined: Wed Feb 16, 2005 5:20 pm
Location: IL

Post by chalasaniamith »

thats true we have to give default value to the parameter.Otherwise it wont be compiled.And if we gave default value its not going to work.
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

chalasaniamith wrote:thats true we have to give default value to the parameter.Otherwise it wont be compiled.And if we gave default value its not going to work.
You cannot type in anything other than numbers in the tab for the Abort After Rows. So there is no way you can pass a parameter to this.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What about UtilityAbortToLog. That will work.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chalasaniamith
Participant
Posts: 36
Joined: Wed Feb 16, 2005 5:20 pm
Location: IL

Post by chalasaniamith »

did u used it any time before..i just want make sure :)
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Used it in a server job. Can test it on px tomorrow and let you know. It really wont bite, you can try it out for yourself. Fix up a small test job and test it out.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

DSguru2B wrote:What about UtilityAbortToLog. That will work.
I guess this could be possible, give it a try

Code: Select all

If PAR_NAME =1 then Incolumn.ColumnA else UtilityAbortToLog('Job Aborted')
Where PAR_NAME is the Parameter Name and 1 is Parameter Value

Play with the parameters.

Did I understand your question right?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Since UtilityAbortToLog is written as a transform function, it can not be used in parallel jobs unless a BASIC Transformer stage is used...

Aneesh
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

If you need to pass the number of rows as the parameter, then the best bet will be to build a Custom Stage using the Abort operator.

I haven't really used it in a live job, but have played with it quite successfully.

Aneesh
Last edited by thebird on Fri Dec 08, 2006 9:45 am, edited 1 time in total.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I take my words back. UtilityAbortToLog wont work inside the px transformer. The only other work around that i can think of at the moment is writing an after job subroutine and check for number of rows in that particular link. If its more than what you want, you can call DSLogFatal() routine or even UtilityAbortToLog from there.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

thebird wrote:Since UtilityAbortToLog is written as a transform function, it can not be used in parallel jobs unless a BASIC Transformer stage is used...

Aneesh
Good to know that!
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Post Reply