Page 1 of 1

Abort of Job

Posted: Sat Aug 23, 2008 3:22 am
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...

Posted: Sat Aug 23, 2008 3:47 am
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?

Posted: Sat Aug 23, 2008 7:52 am
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.

Posted: Sun Aug 24, 2008 8:42 pm
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....

Posted: Sun Aug 24, 2008 9:00 pm
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?

Posted: Sun Aug 24, 2008 9:21 pm
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...

Posted: Sun Aug 24, 2008 10:47 pm
by ray.wurlod
Yes, as noted in my earlier post.