Triggering a Link

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

chowdary
Participant
Posts: 38
Joined: Thu Jun 23, 2005 11:25 am

Triggering a Link

Post by chowdary »

People,

Is there any way that i can tell the link to start processing rows afte the particular link got completed in a server job (not in the Sequnce job),

Please throw some suggestions,

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

Post by ray.wurlod »

What link, where?
There is insufficient information in your question.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Chowdary

If I understood you correctly, it's datastage Architecture. You can never control the way it works. It's already designed in such a way that as soon as its required link is finished it will start processing its next step. Are you trying to control the stages inside your jobs to run when you want ?....
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
chowdary
Participant
Posts: 38
Joined: Thu Jun 23, 2005 11:25 am

Post by chowdary »

People,

Sorry for confusing you all people,
My Job is like this

OCI1(TableA)
|
|
|
\/
Transformer-----Link1---------->XML File
|
|
Link2
|
|
\/
OCI2(Table B)



Once the Data is dupmed into XML file from Table A, i need to Update or Insert a row in Table B which will have Job name and JobStartTimeStamp based on job Id (job id is a key in table B,each job will have auniq id).

So i want Link2 should start processing after Link1 is done.

Can i do that?

Please thorow suggestions.

Thanks
Chowdary
sanjay
Premium Member
Premium Member
Posts: 203
Joined: Fri Apr 23, 2004 2:22 am

Post by sanjay »

Hi

U can use sequencer .


Thanks
Sanjay

chowdary wrote:People,

Sorry for confusing you all people,
My Job is like this

OCI1(TableA)
|
|
|
\/
Transformer-----Link1---------->XML File
|
|
Link2
|
|
\/
OCI2(Table B)



Once the Data is dupmed into XML file from Table A, i need to Update or Insert a row in Table B which will have Job name and JobStartTimeStamp based on job Id (job id is a key in table B,each job will have auniq id).

So i want Link2 should start processing after Link1 is done.

Can i do that?

Please thorow suggestions.

Thanks
Chowdary
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

Whaty Sanjay is saying is that you would have to break that up into two different jobs if you have that requirement. But looking at your job setup I don't see why that would be a requirement. Why exactly does the XML file need to be populated at the same time instead of simultaneously?
chowdary
Participant
Posts: 38
Joined: Thu Jun 23, 2005 11:25 am

Post by chowdary »

Williams,

I would need to update the time when in the job ran in the Table B, when the job runs next time the time in the Table B is used while to select the Delta data from table A , that is why i need to put in the same job instead of sequencer as i need the DSJ.JOBSTARTTIMESTAMP.

so please suggest me some ideas

Thanks
kwwilliams wrote:Whaty Sanjay is saying is that you would have to break that up into two different jobs if you have that requirement. But looking at your job setup I don't see why that would be a requirement. Why exactly does the XML file need to be populated at the same time instead of simultaneously?
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Chowdary

What you can do is use a Aggregator Stage and use the Last function to update a record when the the last record is read. In your existing design in place of Link2 add the Aggregator stage which will solve your problem
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
tcj
Premium Member
Premium Member
Posts: 98
Joined: Tue Sep 07, 2004 6:57 pm
Location: QLD, Australia
Contact:

Post by tcj »

Use a seq stage between the transformer and the OCI table.

Pass record information you want to insert/update to the seq stage then have a third link go from the seq stage to the OCI2(table B) stage. This will be the second part of the job. It will only run once the XML file has been build.

I have used this method many times to update audit information in oracle tables after the main part of the job has completed.

HTH

Tim
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

In the release that I am in I would just use the Macro DSJOBSTARTTIMESTAMP to populate a field in table B. That seems to be totally unrelated to the file. But my perception is that I don't understand your question fully. What is the purpose of the XML file and how is it related to the table?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would do the same - there's absolutely no reason to force a wait until the end of the job to record the time the job started.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chowdary
Participant
Posts: 38
Joined: Thu Jun 23, 2005 11:25 am

Post by chowdary »

People,

Thanks for all you inputs, I am able to update the Audit table if job reads rows form the source table, but now i am facing another problem, if zero rows are processed the Audit table is not getting updated,

I want to update the time of the job ran, even if zero rows are processed.

how can i do that?

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

Post by ray.wurlod »

You can't trigger that from within the job while rows are being processed. You need to detect, afterwards, that 0 rows were processed, and update the audit table with that information. This may require another small job (to update the audit table) and a routine to detect the link row count.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... but you could. :wink: Drop a second Transformer in there and hook the OCI stage to that one instead. Add a dummy stage variable, the macro in the derivation and a constraint on the output link of @OUTROWNUM=1 and you'll always get one row down it, even if the 'main' job processes zero rows.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chowdary
Participant
Posts: 38
Joined: Thu Jun 23, 2005 11:25 am

Post by chowdary »

Chulett,

Thanks for the input, i tried that one, it works but it has small problem, problem is for some reason the upper stream which pulls data from Table A and sumps into XML file failed in some 1000 th row, by that time the Audit table is geeting updated and it is not getting roll back.

i don't know how to get that one rolled back

chulett wrote:Ah... but you could. :wink: Drop a second Transformer in there and hook the OCI stage to that one instead. Add a dummy stage variable, the macro in the derivation and a constraint on the output link of @OUTROWNUM=1 and you'll always get one row down it, even if the 'main' job processes zero rows.
Post Reply