Page 1 of 1

before job routine & after job routine

Posted: Sat Apr 12, 2008 7:18 am
by chvenkat.v
Hi


What is the difference b/w before & after job routines in Datastage? And when we will use those routines in datastage jobs (i.e. tell me situations when we are using them in datastage jobs and why)

thnks
venkat

Posted: Sat Apr 12, 2008 7:57 am
by ArndW
Before job routines get executed before a job starts and an after-job subroutine gets executed after a job successfully completes. If you have actions that need to be performed at these times then you can code your routines to do this.

Posted: Sat Apr 12, 2008 5:04 pm
by ray.wurlod
Before/after routines are executed once (maximum) per job run.

Transform functions are executed once per (output) row.

One example of an after-job subroutine is to archive/rename the file that has just been processed by the job.

Re: before job routine & after job routine

Posted: Mon Apr 14, 2008 7:44 pm
by John Smith
chvenkat.v wrote:Hi


What is the difference b/w before & after job routines in Datastage? And when we will use those routines in datastage jobs (i.e. tell me situations when we are using them in datastage jobs and why)

thnks
venkat
there are many different situations where you might consider using it, most time if you need to call a unix script to do something before the job runs you will use the Before job routine. Examples of this would be say some file (data)cleansing or massaging,generating schema files,checking that trigger file exists,running a FTP script to grab files,sending notification via emails/sms and so on.
After Job routines may be some cleanup scripts,archiving,renaming files,getting some statistics ,sending email notifications of job completion and so on.
question is what do you want to do ?