DSGetLinkInfo returning Warning

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

Post Reply
ramsfriends
Participant
Posts: 8
Joined: Fri Sep 19, 2008 6:15 am

DSGetLinkInfo returning Warning

Post 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
-Rams
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post 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?
ramsfriends
Participant
Posts: 8
Joined: Fri Sep 19, 2008 6:15 am

Post 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]
-Rams
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

Have you checked "Log Warnings after activities that finish with status other than OK". This will cause the warning
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It seems as if you have written a before-after job routine instead of a user function.
ramsfriends
Participant
Posts: 8
Joined: Fri Sep 19, 2008 6:15 am

Post by ramsfriends »

Am calling the routine in a Routine Activity with in a sequnce
-Rams
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
ramsfriends
Participant
Posts: 8
Joined: Fri Sep 19, 2008 6:15 am

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

Post by chulett »

#2 is your culprit.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ramsfriends
Participant
Posts: 8
Joined: Fri Sep 19, 2008 6:15 am

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

Post by chulett »

What do you mean, change the names? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply