Conditional Abort in the job on failure of the condition
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 12
- Joined: Wed Jun 13, 2007 2:12 am
Conditional Abort in the job on failure of the condition
I have a job which needs to abort, when a particular condition fails and write to sequential Error File with message that indicate cause of error.
For which I have used "Abort After Rows = 1" functionality in Transformer, but the thing is when that specific conditon fails then job does not create sequential file and it directly aborts.
If anybody can provide me the solution for this, i would be thankful.
Regards,
Gaurav
For which I have used "Abort After Rows = 1" functionality in Transformer, but the thing is when that specific conditon fails then job does not create sequential file and it directly aborts.
If anybody can provide me the solution for this, i would be thankful.
Regards,
Gaurav
Re: Conditional Abort in the job on failure of the condition
What 'specific condition'? What abort? Not a whole heck of a lot to go on.gaurav_shukla wrote:the thing is when that specific conditon fails then job does not create sequential file and it directly aborts.
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 12
- Joined: Wed Jun 13, 2007 2:12 am
Re: Conditional Abort in the job on failure of the condition
I have Datastage job and which verifies Header Record in a particular file, it checks that first column of header file should be 'A'.
If first column record is not 'A' then it should write error message(Invalid Header) in Error File(Sequential File) and after that the Datastage job should abort.
The Structure of the job is given below:
Database Extract Error File
| |
| |
| |
Seq. file ---> Lookup Stage ---->Transformer (Validation) ------> Transformer (Abort) -------------> Copy stage
First it should read header file from input stage then lookup for some more validation (like date of creating header file) then transformer to check 'A' in first column and same validation for other column as well,
in this i have constraint which diverts record in case of validation failure to next transformer and seq. file, after that it will abort the job in next transformer and then a dummy copy job. If no validation fails then datastage job finish succesfully at first transformer.
This design works good except in case of validation failure, it directly aborts without writing to this error file and no file is created.\
Hope this information help.
If first column record is not 'A' then it should write error message(Invalid Header) in Error File(Sequential File) and after that the Datastage job should abort.
The Structure of the job is given below:
Database Extract Error File
| |
| |
| |
Seq. file ---> Lookup Stage ---->Transformer (Validation) ------> Transformer (Abort) -------------> Copy stage
First it should read header file from input stage then lookup for some more validation (like date of creating header file) then transformer to check 'A' in first column and same validation for other column as well,
in this i have constraint which diverts record in case of validation failure to next transformer and seq. file, after that it will abort the job in next transformer and then a dummy copy job. If no validation fails then datastage job finish succesfully at first transformer.
This design works good except in case of validation failure, it directly aborts without writing to this error file and no file is created.\
Hope this information help.
Database Extract Error File
| |
| |
| |
Seq. file ---> Lookup Stage ---->Transformer (Validation) ------> Transformer (File create) -------------> Transformer(Abort) -------------> Copy stage
Link ordering in the first transformer should be seeq link and then the link to the other transformer. Try this and see.
| |
| |
| |
Seq. file ---> Lookup Stage ---->Transformer (Validation) ------> Transformer (File create) -------------> Transformer(Abort) -------------> Copy stage
Link ordering in the first transformer should be seeq link and then the link to the other transformer. Try this and see.
-
- Participant
- Posts: 12
- Joined: Wed Jun 13, 2007 2:12 am
I have tried with Link ordering as well but its still not creating file.
Is this something to do with Configuration file ( 1 node 0r 4 Node) or something to do with partitioning or Execution mode (Sequential or Parallel).
If anybody have diffrent desgin to achive such functionality please share with me.
Is this something to do with Configuration file ( 1 node 0r 4 Node) or something to do with partitioning or Execution mode (Sequential or Parallel).
If anybody have diffrent desgin to achive such functionality please share with me.
-
- Participant
- Posts: 12
- Joined: Wed Jun 13, 2007 2:12 am
One way of doing this will be to use an After Job abort routine . There are a couple of advantages that i see
You will get all the rejected data that way , that failed the condition.
Have a constraint on your XFM to output these "exception" records and in the abort routine use the record count on the link to decide if you want to abort or not.
You will get all the rejected data that way , that failed the condition.
Have a constraint on your XFM to output these "exception" records and in the abort routine use the record count on the link to decide if you want to abort or not.