Expect to abort job after ...

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

Post Reply
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Expect to abort job after ...

Post by videsh77 »

In our job design, We are filtering out offending entries from the DB, after the previous copletion of ETL operation. These filtered entries we are expected to direct to a sequential file.
If this sequential file at the end of the job is non-empty, is there any way we can abort the job, so further stream of execution would not progress.
Thanks with regards,
videsh.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

After-job routine, check filesize, call DSLogFatal() if non-empty.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gaurav_shukla
Participant
Posts: 12
Joined: Wed Jun 13, 2007 2:12 am

Re: Expect to abort job after ...

Post by gaurav_shukla »

videsh77 wrote:In our job design, We are filtering out offending entries from the DB, after the previous copletion of ETL operation. These filtered entries we are expected to direct to a sequential file.
If this sequential file at the end of the job is non-empty, is there any way we can abort the job, so further stream of execution would not progress.
I think you can use transformer, it has a constraint of 'Abort after Rows'.

Use that for your Sequential file link, and set it to 1.

That will abort the job if any row passes through that link.
truenorth
Participant
Posts: 139
Joined: Mon Jan 18, 2010 4:59 pm
Location: San Antonio

Re: Expect to abort job after ...

Post by truenorth »

videsh77 wrote:If this sequential file at the end of the job is non-empty, is there any way we can abort the job, so further stream of execution would not progress.
I'm confused by this. If you reach the end of the job wouldn't it be too late to abort it? Unless you're talking about a job sequence?
Todd Ramirez
Sr Consultant, Data Quality
San Antonio TX
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

chulette -
Are you referring to write a Shell script, which checks file size & call DS routine ?

or write a DS routine itself ExecSH ?

Gaurav -
We already have that solution elsewhere, but limitation with this approach, you will never realize which all entries are offending, because after very first row, your job is going to get aborted.

Truenorth -
I understand your concern. But the proble is we have seen our DB operation is failed & batch progressed as normal. So this is going to be a counter check to ensure we have addressed anomalies, at this logical checkpoint.
Thanks with regards,
videsh.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

its has to be a custom after-job subroutine which checks the file size of the reject file and call DSLogFatal() if not empty and return a non zero value as error code.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, that would be best. A script can also be used to pass back a non-zero return / exit code and the job will recognize it, however (from memory) it will log a warning rather than abort. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

I have adopted the path suggested by chulette, & I have modified ExecSH subroutine, to raise Fatal error, in case a script happens to run into failure.

This worked for me ...

Thanks all for your contribution.
Thanks with regards,
videsh.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hopefully you created a modified version of ExecSH (like ExecSHFatal) rather than change the delivered one that everyone uses, yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply