Same job with different functions

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
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Same job with different functions

Post 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
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Delete file in before subroutine and keep file option as append....


Thanks,
Anupam
pkomalla
Premium Member
Premium Member
Posts: 44
Joined: Tue Mar 21, 2006 6:18 pm

Post by pkomalla »

If you call the sequencer from unix .......then you can clear the file while you call the job .
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

hey thanks all...

I used Kumar's method...its working
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Post Reply