Page 1 of 2

sequence issue

Posted: Thu Jan 10, 2008 12:18 pm
by just4u_sharath
Routine activity always fails if returned value is other than 0. Then what is the need of allowing dufferent expression types like (custom, retun value..) . Is this a bug in datastage. So if i get a return value other than 0 and if i dont uncheck the "automatic handling" and 'Log warning if status other than OK' in job properties, this means i cannot use a rotuine. How can i get through this. i like to use a rotuine which returns other value.

Re: sequence issue

Posted: Thu Jan 10, 2008 12:53 pm
by ArndW
just4u_sharath wrote:Routine activity always fails if returned value is other than 0.
That is not correct.

Or are you talking about a job Before and After subroutine?

Posted: Thu Jan 10, 2008 1:36 pm
by chulett
It is considered to have failed if the 'Automatically handle activities that fail' option is enabled, yes. Simply enough to 'fix', however - the documentation clearly states how you can handle it so the 'automatically' part doesn't kick in.

In other words, it only handles it if it thinks you haven't.

sequence issue

Posted: Thu Jan 10, 2008 2:06 pm
by just4u_sharath
chulett wrote:It is considered to have failed if the 'Automatically handle activities that fail' option is enabled, yes. Simply enough to 'fix', however - the documentation clearly states how you can handle it so the 'automatically' part doesn't kick in.

In other words, it only handles it if it thinks you haven't.
In routine is value of 10 is returned (what we want is 10 in this case) and the job is success from our side, but from sequencer side it logs as a warning. To eradicate this the only possible way is to uncheck those two default settings. But unchecking them may effect other parts of sequence if we dont handle failed activites. "In other words, to run rotuine activity successfully, sacrifice the error handling of other activites". Am i right.
If i am wrong please guide me

Re: sequence issue

Posted: Thu Jan 10, 2008 3:56 pm
by chulett
just4u_sharath wrote:To eradicate this the only possible way is to uncheck those two default settings.
Incorrect. As I noted, the documentation tells you what you need to do. Bring up the online help, switch to the Index tab and search for Job Properties. At the bottom of the Help page, click on General on the Sequence job line. Then click on either of the 'add checkpoints' or 'automatically handle' options for details.

That or search the forums, it has been discussed quite a number of times.

Posted: Thu Jan 10, 2008 3:56 pm
by ray.wurlod
Have you tried using a custom trigger based upon the routine's return value?
Or an explicit Failure trigger so that you're explicitly handling the "failure"?

sequence issue

Posted: Thu Jan 10, 2008 7:06 pm
by just4u_sharath
ray.wurlod wrote:Have you tried using a custom trigger based upon the routine's return value?
Or an explicit Failure trigger so that you're explicitly handling the "failure"?
what i have done is
In the routine activity i called a user defined routine which will retun value greater than 0. In the trigger page, selected custom expression type and in the expression "Nameofactivity.$CommandOutput>0". This should trigger another job. But the routine failed. This is what custom trigger right? What is Explicit trigger? is this name of an activity

Posted: Thu Jan 10, 2008 8:20 pm
by chulett
Apparently what you have not done is read the docs.

sequencer issue

Posted: Fri Jan 11, 2008 12:49 am
by just4u_sharath
chulett wrote:Apparently what you have not done is read the docs.
Yes. Its true. So if any condition returns other than zero, then i should not use routine.

Can i do like this.
My trigger condition returns value other than 0. I will not uncheck those 2 conditions. Can i still use a routine for this. Can you explain me what is explicit trigger

Posted: Fri Jan 11, 2008 2:55 am
by ray.wurlod
I used the word "explicit" to differentiate a Failure trigger from a Custom trigger. If you have a Failure trigger, then that takes precedence in the automatic handling. Which, if you had read the help or the manual, you would have realized.

Posted: Fri Jan 11, 2008 5:34 am
by balajisr
Call your routine from "User Variable Activity". Use the value of the user variable to trigger downstream activities. Routine activity is not required.

Re: sequencer issue

Posted: Fri Jan 11, 2008 7:56 am
by chulett
just4u_sharath wrote:
chulett wrote:Apparently what you have not done is read the docs.
Yes. Its true. So if any condition returns other than zero, then i should not use routine.
Again, no. And again, the docs describe how to use automatic handling with a routine that does not return a zero. It's all in the triggers.

sequence issue

Posted: Sat Jan 12, 2008 3:23 pm
by just4u_sharath
balajisr wrote:Call your routine from "User Variable Activity". Use the value of the user variable to trigger downstream activities. Routine activity is not required.
i tried to use the user variables activity. But the trigger expression type is always unconditional. How we can give trigger condition in user variables activity

Posted: Sat Jan 12, 2008 11:35 pm
by ray.wurlod
You can't.

What you can do is assign the required value to one of the user system variables (@User.Return.Code or @USER0 through @USER4), have the routine return 0, and have the User Variable access the system variable. This will work because they are all in the same process.

Posted: Sun Jan 13, 2008 11:15 pm
by balajisr
just4u_sharath,

User variable activity does not have any other trigger other than 'unconditional'.

Call routine from user variables activity and store the value in a variable.
Use nested activity to read the value of the user variable and trigger the downstream job if the variable is > 0.Or implement as per Ray's advice.