Page 1 of 1

DSGetLinkInfo returning Warning

Posted: Thu Oct 30, 2008 1:17 am
by ramsfriends
Hi Gurus,

Am new to Datastage and trying a small case study. My requirement is like this:
I have 1 job which inserts records in a table based on some condition. Then i have a routine to check if the earlier job inserted any rows in the table or not; if yes, then proceed with next job else exit from the execution by logging some warning message.

To do so, I have the below routine code.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H


JobName   = Field(Arg1,';',1)
StageName =Field(Arg1,';',2)
LinkName =Field(Arg1,';',3)

JobHandle = DSAttachJob (JobName, DSJ.ERRFATAL)

Ans = DSGetLinkInfo (JobHandle,StageName, LinkName, DSJ.LINKROWCOUNT)

And am calling the above routine as
JobName;StageName;LinkName

When I tested this in DS Manager it returns me the exact value, but when i put this in a sequence and execute its returning the row count correctly, but with text "Warning: Routine DSU.GetLinkCount did not finish OK, return code = '259'" fyi - 259 is the correct number of records inserted to the table in prev. job

I am curious as to know why it is a Warning than Info or something else.

Thanks in advance for your time

~Rams

Posted: Thu Oct 30, 2008 2:57 am
by DS_SUPPORT
Might be, you have checked "Automatically Handle Activities that fail" in the job properties of your sequencer, which will treat that routine has failed if it returns value other than 1. Uncheck it and try running the job.

Or is there any triggers from your routine activity, which is causing this warning?

Posted: Thu Oct 30, 2008 3:13 am
by ramsfriends
Hi Thanks for your time.

But
1) The check box is unchecked
2) I have 3 activities/links from the routine activity with below condition
return value > 0 -then - CALL Next Job
return value >= 0 -link to a sequncer which collects the status of all "Finished Ok"
return value < 0 - link to a sequncer which collects the status of all failure/aborts

Can you through somemore light on this please?[/code]

Posted: Thu Oct 30, 2008 4:01 am
by DS_SUPPORT
Have you checked "Log Warnings after activities that finish with status other than OK". This will cause the warning

Posted: Thu Oct 30, 2008 4:21 am
by ArndW
It seems as if you have written a before-after job routine instead of a user function.

Posted: Thu Oct 30, 2008 5:01 am
by ramsfriends
Am calling the routine in a Routine Activity with in a sequnce

Posted: Thu Oct 30, 2008 6:44 am
by chulett
The answer is simple - it thinks it failed because it did not return a zero. As to why - please post whatever Compilation options you have checked on the General tab of the Sequence's job properties page.

Posted: Thu Oct 30, 2008 8:00 am
by ramsfriends
The Options checked are
1. Add checkpoints so sequence is restartable on failure
2. Log warning after activities that finish with status other than OK
3. Log report messages after each job run

But not "Automatically handle activities that fail"

Posted: Thu Oct 30, 2008 8:26 am
by chulett
#2 is your culprit.

Posted: Fri Oct 31, 2008 3:23 am
by ramsfriends
Actually when I change the stage and link name in the routine activity the issue is resolved, though it looks strange.

Thanks all for your time and help

Posted: Fri Oct 31, 2008 7:51 am
by chulett
What do you mean, change the names? :?