Using DSJ.LINKROW

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
boligoma
Premium Member
Premium Member
Posts: 24
Joined: Tue Apr 24, 2007 3:07 pm

Using DSJ.LINKROW

Post by boligoma »

Hi,

I'm using the expression DSGetLinkInfo (handleJob, StageName2, LinkName2, DSJ.LINKROWCOUNT) to create new keys for a table, but I need to know how many rows has the original file.

The original file (a sequential file) has 13276 rows but the result of the Getlinkinfo column is always -6. This means that this function only gets the last digit of the maxrownumber ?

Any ideas?

Thank you!!
Ismael Martinez
Intellego SC
www.grupointellego.com
Abburi
Participant
Posts: 31
Joined: Tue May 29, 2007 12:38 pm

Re: Using DSJ.LINKROW

Post by Abburi »

boligoma wrote:Hi,

I'm using the expression DSGetLinkInfo (handleJob, StageName2, LinkName2, DSJ.LINKROWCOUNT) to create new keys for a table, but I need to know how many rows has the original file.

The original file (a sequential file) has 13276 rows but the result of the Getlinkinfo column is always -6. This means that this function only gets the last digit of the maxrownumber ?

Any ideas?

Thank you!!
No, It will get the count of how many rows LinkName2 has processed to the next Stage, so it would have given 13276 rows, it means that it is not processing more than 6 rows, check sequential file properties or what ever LinkName2 has linked Stage properties.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, negative numbers are error codes. And a -6 means:

Code: Select all

#define DSJE_WRONGJOB  -6   /* Job for this JobHandle was not started from a call to DSRunJob by the current process. */
See the $DSHOME/include/dsapi.h file.
-craig

"You can never have too many knives" -- Logan Nine Fingers
boligoma
Premium Member
Premium Member
Posts: 24
Joined: Tue Apr 24, 2007 3:07 pm

Post by boligoma »

I tried to put it as a variable in the transformer stage instead of using the expression in the convert derivation area. know the mistake is -7, I don't have access to the unix server (only by DS, not interface).

If I cannot use it before the sequential file link is finished, I have to use a maxcount() or something before using it, right??
Ismael Martinez
Intellego SC
www.grupointellego.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I would strongly advise against using the DataStage API functions on a row-by-row basis. If you must, however, use DSJ.ME for the job handle argument.

What precisely do you need to do? I can not imagine a scenario that would require knowledge of row counts to generate keys. The current row count is available via system variables @INROWNUM or @OUTROWNUM.

If you need to count the source rows, do this in a prior job and store the count somewhere, perhaps in a hashed file (SDKSequences would serve) with a constant key. Or you could store it in the user status area of the prior job and pass it to the main job as a job parameter.

These techniques have been described on the forum, please search for them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply