Abort of 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
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

Abort of Job

Post by monaz »

How can i abort the job. if no records exist for the day... my job is daily delta basis .
1) i can do this in after job subroutine..? also my after job subroutine is already have query for concatenating all the sequential file present in the job. Can i include the query for job abort in same after job subroutine..?

2)Else how can i proceed this becoz i am using two different databases for extracting the data daily..
Is anyway we can take record count and abort the job.

Please advice me on this...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm a bit confused about the requirement. If your job is in the after-job subroutine already then it will complete anyway, specifying a non-zero return code from this subroutine will ensure that the job's status is aborted.

Could you perhaps explain a bit more on what conditions need to occur in order for your job to have to abort?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can check before or after job for zero records and then decide what you need to do. That 'before' or 'after' could be in the job itself or outside the job leveraging a Sequence job. You could use a routine that checks the file size itself, or one that checks for the number of records written to the file by the job. Or a 'pre job' that checks your source for records before the main processing job runs and again a Sequence can test and branch accordingly.

All kinds of ways.
-craig

"You can never have too many knives" -- Logan Nine Fingers
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

Post by monaz »

Thanks Guru's ....
Okey let me make my requirement clear...
I want to abort the job if no record exists for the day. So i wanted to know how can i proceed this:-

1) I have already used after job subroutine for cancatenating the header, body and foooter file.
So can i include in the same after job subroutine creteria to abort the job. what creteria i can apply here..?

Is this possible...?

Please advice....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Number of lines in the file = 2 (header and footer only). This is your "abort" criterion (shudder!). Why not check before doing any of the ETL?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

Post by monaz »

Sorry,
The job creteria is Abort the job if no records exist for the day... I am scheduling this job daily which will run at 4am eveyday.. so job should be aborted if no records exists.

my job will pick account numbers and name everyday.

So my question was that can i include any creteria to do this...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, as noted in my earlier 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.
Post Reply