Page 1 of 1

Same job with different functions

Posted: Thu Jun 22, 2006 3:31 am
by parag.s.27
Hi All,

I am using a single job in a sequence for abt 5 times i.e same job is running 5 times in a single sequence. The first time it is executed it generates a balance sheet file for dec, next time jan and so on...


Now i need that 1st time when it runs in the sequence it should simply overwrite the existing file but when the 2nd time same job is run in the sequence it should append the data to the existing file....

summary:-

in a single output file i need Dec, jan, feb, mar, and apr data.....

thanks in advance

Posted: Thu Jun 22, 2006 3:45 am
by ray.wurlod
If it's never been run before, "append" will create the new file. Otherwise you can include a Nested Condition activity to determine whether to truncate the file before running the remainder of the Job activities. This will have two outputs (yes and no); the yes goes into, say, an Execute Command activity to truncate file. Output from the Execute Command activity and the no output fron the Nested Condition activity are brought together in an Any sequencer, then the "append" job is run from a Job activity.

Posted: Thu Jun 22, 2006 4:12 am
by sb_akarmarkar
Delete file in before subroutine and keep file option as append....


Thanks,
Anupam

Posted: Thu Jun 22, 2006 5:32 am
by pkomalla
If you call the sequencer from unix .......then you can clear the file while you call the job .

Posted: Thu Jun 22, 2006 7:41 am
by kumar_s
Use Execute command activity to clear the file at first. Later call the job using job activity with update action inthe job for 5 times.

Posted: Thu Jun 22, 2006 7:47 am
by parag.s.27
hey thanks all...

I used Kumar's method...its working