Page 1 of 1

Count issue

Posted: Thu Jun 14, 2012 7:52 am
by hargun
Hi,

I have probelm reagrding getting Target count using routine which i am using in sequence.The rotuine is as follows

$INCLUDE DSINCLUDE JOBCONTROL.H

valid = @FALSE
Hjob1=DSAttachJob(JobName,DSJ.ERRFATAL)

Status=DSGetJobInfo(Hjob1,DSJ.JOBSTATUS)
Call DSLogInfo("Status of the job is ":Status,"Routine")

count1=DSGetLinkInfo (Hjob1, SStage, SLink,DSJ.LINKROWCOUNT)
Call DSLogInfo("Source Count is ":count1,"Routine")

count2=DSGetLinkInfo (Hjob1, TStage, TLink,DSJ.LINKROWCOUNT)
Call DSLogInfo("target Count is ":count2,"Routine")

count3=DSGetLinkInfo (Hjob1, UStage, ULink,DSJ.LINKROWCOUNT)
Call DSLogInfo("Source Count is ":count3,"Routine")

count4=DSGetLinkInfo (Hjob1, DStage, DLink,DSJ.LINKROWCOUNT)
Call DSLogInfo("target Count is ":count4,"Routine")

Count = count1 : '|' : count2 : '|' : count3: '|' : count4
Call DSLogInfo("Total Counts After Concatination ":Count ,"Routine")

Ans=Count
This i am using in sequence to get source and target count.

My job design is


db2
.

DB2............................look up .........copy....................dataset

when i use this job in sequence couldn't be able to get target count but after changing the dataset with sequential file and then use job in sequnece,and run it then i am able to see the target count using that routine.

I don't know why its working for sequential file/other stages not for dataset.I had tested that routine and showing the target count but in job i didn't get.

Posted: Thu Jun 14, 2012 9:07 am
by chulett
From what we've seen here over the years it is a known "issue" with datasets, kind of surprised it is still an issue. I would think it would be worth asking your official support provider about.

Posted: Thu Jun 14, 2012 4:32 pm
by ray.wurlod
Two other possibilities.

Your Copy stage might be being optimized out of the design (so could not deliver a row count). Set its Force property to ensure that it is in the flow.

Instead of the input row count to the Data Set stage you could obtain the output row count from the Copy stage (which is necessarily the same if the job completes successfully).

DSJ.LINKROWCOUNT not working for Datasets

Posted: Sun Aug 19, 2012 5:08 pm
by synsog
We are also facing the same issue where by when we do want to capture the record count for datasets using DSJ.LINKROWCOUNT , it yields 0 where as if the stage has been replaced with some other stage the record count gets captured.

Initially , the dataset stage itself was not getting captured since we were using DSJ.STAGELIST however later on we used DSJ.FULLSTAGELIST as a result of which at least the stage was getting captured and the corresponding link name for the same. However despite all this , we cannot still capture the record counts for the dataset.

Is there a solution for this bug ?? do we need to raise a PMR or something for this ??? .. As per Ray's comments we can have another stage prior to the dataset say the copy stage and manage to capture the record count. However this would just be a work around and perhaps we will have to unnecessarily plant a stage before the dataset just to capture the record count. .

Just want to know whether a fix for this has taken place or not.. Many thanks in advance for your valuable replies :)

Posted: Sun Aug 19, 2012 8:22 pm
by chulett
As you noted, that would be a question for IBM.