Hi i have developed a sever job which is pretty simple,It just has Oracle Stage which will Extract data into the Sequential file.
But many times query is not pulling the records from table so the black file is getting generated
Can you please tell me how to abort the job if the no data gets fetched?
How to abort the job
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Why bother? You can check the row count in an after job subroutine and set the ErrorCode argument to a non-zero value to abort the job. You may like to have the after job subroutine delete the empty file first.
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.
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In an after job subroutine use DSGetLinkInfo() to determine whether any rows were sent to the target file. If the row count is zero delete the file and (optionally) set the ErrorCode argument of the subroutine to a non-zero value, which has the effect of aborting the job. But I don't believe you need to abort the job in this case; it is probably sufficient to log an alert (warning) that no rows were processed.
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.
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: