Is there a good way to force a job to abort? I am doing balancing where the final result has to be zero. I have a field called total_difference which is a decimal (15,2). If it's zero, I set a field called abort_sw to 'C' for continue, else I set it to spaces. Abort_sw is a 1 char field.
I found that if I reference the abort_sw in a SWITCH Stage, the job will abort if it's spaces & doesn't abort if it's 'C'. This was found by accident. We are novices here & I'm not confident this will always work.
Thanks for any help.
Forcing a job to abort
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I always advocate never allowing jobs to abort.
That way the controlling job can remain in control.
If there are problems these can be recorded, in the job log or elsewhere, and detected by the controlling job. Because the controlling job is still in control, it can take any required remedial action and notification action.
For example, in your case, the job could write the balance into a text file, and the controller could use code (or a Command activity, if a sequence) to determine the contents of that file.
That way the controlling job can remain in control.
If there are problems these can be recorded, in the job log or elsewhere, and detected by the controlling job. Because the controlling job is still in control, it can take any required remedial action and notification action.
For example, in your case, the job could write the balance into a text file, and the controller could use code (or a Command activity, if a sequence) to determine the contents of that file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rich - I decided to try your suggestion on using the transformer to cause an abort & it seems to work. I couldn't find any documentation on the 'abort after rows' option, but I think it evaluates the constraint & if it's TRUE, the job will abort after the number of rows where the condition is met.
Instead of using an abort_sw, I check for my TOTAL_DIFFERENCE <> 0.
I set the 'abort after rows' to 1 as I will only have one row.
Please let me know if my thinking is correct.
Thanks!
Instead of using an abort_sw, I check for my TOTAL_DIFFERENCE <> 0.
I set the 'abort after rows' to 1 as I will only have one row.
Please let me know if my thinking is correct.
Thanks!
Hi,
For the first part of your question open the transformer and click the Help button. Click on 'Abort after Rows' property on the Help screen it will pop up necessary documentation that you need. Here is the documentation for Abort after Rows
For the second part the data flows downstream when the condition in the constraint is satisfied. In your case it is TOTAL_DIFFERENCE <> 0. If you are sure that only one record would come through then go ahead and set Abort after Rows property to 1. Your thinking is right if this is the case.
HTH
--Rich
Think about what you are thinking because as a man thinks so does he become
--Joyce Meyer
For the first part of your question open the transformer and click the Help button. Click on 'Abort after Rows' property on the Help screen it will pop up necessary documentation that you need. Here is the documentation for Abort after Rows
Code: Select all
Enter the number of rows that can come down this link before the job is aborted. If you specify no number, then there is no limit.
HTH
--Rich
Think about what you are thinking because as a man thinks so does he become
--Joyce Meyer