Page 1 of 1

GetLinkCount error.

Posted: Tue Mar 24, 2009 1:12 pm
by efxuser
Iam planning to use this in the end of a sequence to fetch counts from both parallel as well as server jobs.Am i on the right track?

FUNCTION GetLinkCount(JobName, StageName, LinkName)
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF

hJob = DSAttachJob((JobName), DSJ.ERRNONE)
Name = DSGetJobInfo(hJob, DSJ.JOBNAME)
If Name Matches "'-'1N0N"
Then
Ans = "Failed to attach job " : Quote(JobName)
End
Else
Temp = DSGetLinkInfo(hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
Begin Case
Case Temp = DSJE.NOERROR
Ans = Temp
Case Temp = DSJE.BADSTAGE
Ans = "Stage name " : Quote(StageName) : " not found in job."
Case Temp = DSJE.BADLINK
Ans = "Link name " : Quote(LinkName) : " not found in job."
Case @TRUE
Ans = "Error encountered in DSGetLinkInfo. Code " : Temp
End Case
ErrCode = DSDetachJob(hJob)
End
RETURN(Ans)


I tried to test this routine directly using the Test boutine in server routine tab.I pass the name of the job,transformer name and link from the transformer to oracle stage

I get the output as
TEST #1
*******

Arg1 = Job_pre_app_fin
Arg2 = Transformer_51
Arg3 = DSLink52

Test completed.


Result = Error encountered in DSGetLinkInfo. Code 50

I cannot find this code anywhere?any ideas/ help?

Posted: Tue Mar 24, 2009 1:32 pm
by kduke
You need logic to make sure hJob is attached.

Posted: Tue Mar 24, 2009 1:39 pm
by efxuser
I do have this part in my code...right...is this what u meant or is there something else?hJob = DSAttachJob((JobName), DSJ.ERRNONE)
Name = DSGetJobInfo(hJob, DSJ.JOBNAME)
If Name Matches "'-'1N0N"
Then
Ans = "Failed to attach job " : Quote(JobName)

Posted: Tue Mar 24, 2009 1:48 pm
by chulett
That "50" is your count. Your first 'case' statement needs to be corrected, as you only declare the function call good if it returns a zero:

Case Temp = DSJE.NOERROR
Ans = Temp

Posted: Wed Mar 25, 2009 7:33 am
by efxuser
awesome.that works.thanks much