Or call the same Shell script in After-Stage Subroutine in Transformer, to check if Reject file is populated with data.ganesh123 wrote: something like this in Shell script ?
Constraint to abort job
Moderators: chulett, rschirm, roy
Yes, either is possible. Could depend on what you want to happen with the 'good' rows after you've found all the 'bad' ones. If you are working in a database and you want your good changes to commit, do the check after job. If you don't then consider after stage.
In either case, make sure you put an Annotation on the canvas stating what you are doing. Those tend to be fairly invisible (heck, after stage is extremely invisible!) and this Best Practice ensures anyone who looks at the job knows there's more going on that just what's on the canvas. :D
In either case, make sure you put an Annotation on the canvas stating what you are doing. Those tend to be fairly invisible (heck, after stage is extremely invisible!) and this Best Practice ensures anyone who looks at the job knows there's more going on that just what's on the canvas. :D
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks for the response guys...
In my case i'm comparing the counts in a job , ...
INPUTROW COUNT = OUTPUT ROWCOUNT (this is the constraint), if they are equal then the job should run. If not it should fail.
This job will be in a sequence, so even if the job fails after processing all the rows ... atleast it will stop the rest of the sequence.
Could I do it without adding a new file or a reject link to my existing job ?
In my case i'm comparing the counts in a job , ...
INPUTROW COUNT = OUTPUT ROWCOUNT (this is the constraint), if they are equal then the job should run. If not it should fail.
This job will be in a sequence, so even if the job fails after processing all the rows ... atleast it will stop the rest of the sequence.
Could I do it without adding a new file or a reject link to my existing job ?
Thats why we gave you that soln.The condition is col1 = col2
ie: if col1 <> col2 then ABORT JOB
make a stage variable
Code: Select all
sv=if @INROWNUM<>@OUTROWNUM then UtilitytoAbort("Message") else 1
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
Code: Select all
@INROWNUM<>@OUTROWNUM
If its sequential file, count the number of rows using wc -l, and calculate the number of rows read by Datastage (without any error due to metadta mismatch) and raise abort signal after the job completion.
If you have any other condition, check for the number of rows processed in reject link and raise the Abort signal. If you sill want the job to be aborted, call a routine in after job as suggested many times.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'