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!!
Using DSJ.LINKROW
Moderators: chulett, rschirm, roy
Re: Using DSJ.LINKROW
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.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, negative numbers are error codes. And a -6 means:
See the $DSHOME/include/dsapi.h file.
Code: Select all
#define DSJE_WRONGJOB -6 /* Job for this JobHandle was not started from a call to DSRunJob by the current process. */
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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??
If I cannot use it before the sequential file link is finished, I have to use a maxcount() or something before using it, right??
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.