Routine in trigger

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Routine in trigger

Post by samyamkrishna »

Hi,

Is there any way we can use a routine in a trigger.

Without geting the routine is not dimensioned.

I went through a lot of posts regarding this but only found out that it cannot be done.


Regards,
Samyam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm assuming you meant in a Sequence job so off we go to the General forum. And are we talking about a custom / user-defined routine or something else?
-craig

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

Yes it is a user defined routine with

JobHandle=DSAttachJob(JobName,DSJ.ERRWARN)
status=DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
Ans=status
inside it.

i want to use this routine on the trigger to decide the flow of teh sequence.

As of now i am using a routine activity.It is working fine.
but when i use the routine in a trigger then i get not dimensioned error.

Is there anything i can do to use the routine in the trigger.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No. Do what you are doing, using the proper stage and then (I assume) checking the results in any downstream triggers. Make sure you are detaching from the jobs you are checking!

Question - were these jobs run by the current Sequence? I assume not, but wanted to ask and make sure the "why" of what you are doing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

yes these jobs were run by the current sequence.
a execute command activity is triggering a dsjob command.

in which the job name is a parameter.

dsjob -run -wait PRJ #jobname#

and based on teh status we have to trigger the flow of activities.

Now we have two options
1.we can use the retun of the dsjob command
this works fine as long as the job runs for below the timeout set in the admin.
but if it crosses the time out value say 3600 sec.
then even if teh job complets the return value is 141 which is wrong

2. I got the routine working but i cannot use it in teh trigger.


Regards,
Samyam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, in that case, using a Routine Activity stage is the proper answer here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

Thanks craig.
Post Reply