sequence issue

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

just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

sequence issue

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Re: sequence issue

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

sequence issue

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: sequence issue

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

sequence issue

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Apparently what you have not done is read the docs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

sequencer issue

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: sequencer issue

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

sequence issue

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post 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.
Post Reply