warning with Routine return value

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

warning with Routine return value

Post by rkdatastage »

Hi All
I am trying to read the number of row counts of source and target by a transform routine which was built by me , I am getting the correct results when i run the routine individually. I am facing a problem when i call that routine from a sequence.
Problem description : I am receiving a warning messeage like
" WHIDV..JobControl (@Routine_Activity_44): Routine DSU.TestRowCount did not finish OK, return code = '20|20' "

The Sequence executed successfully with this warning. Can someone share your idea how to fix this warning. I am concatenating both source and target rowcount with | delimiter as a return value from the routine

Regards
RK
mahadev.v
Participant
Posts: 111
Joined: Tue May 06, 2008 5:29 am
Location: Bangalore

Post by mahadev.v »

Uncheck the box which says something like "Log warnings for stages that dint finish ok" in the sequence properties.
"given enough eyeballs, all bugs are shallow" - Eric S. Raymond
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Don't simply uncheck anything, rather take the time to understand your issue. A search here for "did not finish OK" will reveal all - the fact that routines that do not return 0 are considered to have failed in certain circumstances and how best to handle that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Hi
I had tried in the forum in finding solution for my problem but i am still not able to resolve it. I tried this viewtopic.php?t=99466&highlight=did+not+finish+OK soultion as well as I tried this

viewtopic.php?t=124647&start=0&sid=e927 ... 42fc8dbf09
solution.

Can some one let me know best way to define the trigger to get rid of warning message.

I tried to to implement the trigger condition with in two methods
Method 1:
In trigger expression i defined two conditions like conditional Failure and otherwise . The output was sent to a sequencer and sequencer Mode to Any.
Method 2:
In trigger expression i defined 3 Return value conditions like =0, >0,<0 .
The output was sent to a sequencer and sequencer Mode to Any.

But still i am getting the warning message.

Thanks in advance

Regards
RK
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Post by Pagadrai »

Hi
mahadev.v has provided you a solution.
have you tried it ?

As Craig mentioned, you need to analyse the warning message.
Your routine has returned a value that is non-zero and datastage thinks that this is some error code/message returned from routine.
sasidhar_kari
Premium Member
Premium Member
Posts: 62
Joined: Wed Dec 08, 2004 2:26 am

Post by sasidhar_kari »

Hi
I don't think doing Unchecking the box "Log warnings for stages that dint finish ok" in the sequence properties is a correct thing.
We had to handle this in routine activity.

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

Post by chulett »

mahadev.v provided a workaround, not a solution.

rk - you would need to post the actual trigger expressions you are using in order for use to help, not 'something like' them but the actual complete triggers copied from the job. You could also check this post and see if helps clear things up for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Hi

Thanks for your response. I had tried to implement your suggestions but again landed with warnings. I had explained in 2 scenario's

Scenario 1 : The Sequence job is getting aborted

Link Name Expression Type Expression
---------- -------------------------------- -----------
First Link ReturnValue - (Conditional) =0
Second Link ReturnValue - (Conditional) >0
Third Link ReturnValue - (Conditional) <0
---------------------------------------------------------------------
Warning Message :
1) Routine DSU.TestRowCount1 did not finish OK, return code = '1000'
2) Controller problem: Unhandled failure (1000) encountered calling routine DSU.TestRowCount1
3) (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors

Note : As my routine is retruning '1000' as output

Scenario 2 : The Sequence job is finished with warning

Link Name Expression Type Expression
---------- -------------------------------- -----------
First Link ReturnValue - (Conditional) =0
Second Link ReturnValue - (Conditional) >0
Third Link ReturnValue - (Conditional) <0
Fourth Link Otherwise N/A
---------------------------------------------------------------------
Warning Message : Routine DSU.TestRowCount1 did not finish OK, return code = '1000'
Note : As my routine is retruning '1000' as output

I had kept sequencer mode to ANY

Please let me know that if some one need any information.

Thanks in Advance

Regards
RK
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

use a uservariable activity and call the routine to assign the return value to variable. and use the variable for your conditional triggering.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Hi
I am able to understand the method. as i am bit confused . Can you please let me know the step by step to implement this.

Thanks in advance

Regards
RK
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

rkdatastage wrote:Hi
I am able to understand the method. as i am bit confused . Can you please let me know the step by step to implement this.

Thanks in advance

Regards
RK
instead of calling the routine directly in the sequence, take a uservariable activity define a user varible and in its derivation call the routine. The return value will be assigned to the user variable which can be used down the line.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or just simplify the triggers.

Does your routine actually ever return a negative number? Do you need to handle a zero differently than a non-zero response? Seems like the answer is no if all of these links feed into an ANY sequencer.

Use two triggers and let me know what happens:

Link 1 - OK (Conditional)
Link 2 - Otherwise


Technically, the OK catches the zero and Otherwise gets everything else, and it now thinks you are handling the error so it doesn't need to. Run both into your ANY Sequencer. Note that this behaviour is also affected by the "Log warnings after activities that finish with status other than OK" option, if you have that enabled, try it also with it unchecked so you can see for yourself the difference in what happens and decide which way works for you here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Hi
Thanks for your response

As per my requirement my routine will never give negative output. I had tried with 2 triggers as specified . I had enabled "Log warnings after activities that finish with status other than OK" and i am getting same warning message.

I had unchecked "Log warnings after activities that finish with status other than OK" and this time there is no warning. But as per my project standards I had to checked "Log warnings after activities that finish with status other than OK" it as no warnings are displayed

Kindly suggest me the way forward to handle it

Thanks in advance

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

Post by chulett »

Per that "standard" then, you'll never be able to use a routine that returns anything other than a zero in a Routine Activity stage without seeing a warning. You'll need to fall back on the UserVariables stage approach that priyadarshikunal mentioned, it seems, if the warning is unacceptable.

Since s/he proposed it, I'll let priyadarshikunal do what they should have done at the same time and explain it fully for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post by rkdatastage »

Hi chulett

Thanks for your response. Thanks for your valable suggestions and guidence in the forum . I had implemented priyadarshikunal solution and it works fine.

Hi priyadarshikunal

Thanks for your response. I am able to solve my issue. Thanks for sharing your ideas.

" I believe great minds will share there thoughts "

Regards
RK
Post Reply