How to abort the job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

How to abort the job

Post by sagar deshmukh »

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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post by sagar deshmukh »

can you please elaborate little more
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post by sagar deshmukh »

I have a one more requiermnt...lets say if query doesnt fetch the data then i get a blank seq. file.....but now if i dont want the job to get aborted also i dont want the blank file to get created can i do that?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not possible within a single job. See solution in my previous post.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The file will always be created.
-craig

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