how to find out howmany records were processed and rejected

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

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

sudhakar_viswa wrote:My reqirement is to do everything in one job.
Why?

Sometimes (often) a more modular approach is far easier to maintain.

Take some advice from an experienced developer - this (everything in one job) should never be a requirement. If "they" try to impose it, challenge them to provide a good reason. If it's your personal requirement, take a good hard look at why you want to do it this way.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I do get row counts at the end of a sequence. Much cleaner and easier. Unless you need row counts to make a decision like send an email if more than 1000 rejects then wait till the end of the sequence.
Mamu Kim
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi DSGuru,

Thanks a lot.And one more thing,if we are using hashed file how can get the count.

Thanks,
sudhakar
i need to know datastage
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Use routine GetLinkCount(JobName, StageName, LinkName) that will give you count ...
You can create a multiple instance job where you can pass parameter to that job and get count for each job...

Thanks,
Anupam
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi,

can i get the just count in the same job

Thanks,
sudhakar
i need to know datastage
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

The system variables
@INROWNUM
and
@OUTROWNUM within the transformer can be used for getting the counts on links.
Success consists of getting up just one more time than you fall.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi loveojha2,

It will give the row by row.I need the total count and i have to store the count in database table.

Thanks,
sudhakar
i need to know datastage
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

You can pass it to an Aggregator stage and take the max of the values out from the aggregator and send it to the database table.
Success consists of getting up just one more time than you fall.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

I think you need following information
1) How many rows selected from source.
2) How many rows insert/updated to target.
3) How many rows reject.

I suggest better to go with GetLinkCount()
@INROWNUM and @OUTROWNUM will not get proper information

Thanks,
Anupam
sb_akarmarkar@smart-bridge.co.in
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

How about using stage variables, which should maintain the counts for the rows processed for every link and keep on writing to an aggregator from within the transformer and taking the max values from the aggregator to the database table.
Success consists of getting up just one more time than you fall.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Suppose
Source Link name is SrcLink
Target Link name is TgtLink
Transformer name between is TransformerX
Link one more transformer name TransformerY to TransformerX
Put constraints @OUTROWNUM = 1

Give following in TransformerY for link count
DSGetLinkInfo(DSJ.ME, "TransformerX", "SrcLink" ,DSJ.LINKROWCOUNT)
DSGetLinkInfo(DSJ.ME, "TransformerX", "TgtLink" ,DSJ.LINKROWCOUNT)

Thanks,
Anupam
sb_akarmarkar@smart-bridge.co.in
[/code]
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

sb_akarmarkar wrote:Suppose
Source Link name is SrcLink
Target Link name is TgtLink
Transformer name between is TransformerX
Link one more transformer name TransformerY to TransformerX
Put constraints @OUTROWNUM = 1

Give following in TransformerY for link count
DSGetLinkInfo(DSJ.ME, "TransformerX", "SrcLink" ,DSJ.LINKROWCOUNT)
DSGetLinkInfo(DSJ.ME, "TransformerX", "TgtLink" ,DSJ.LINKROWCOUNT)

Thanks,
Anupam
sb_akarmarkar@smart-bridge.co.in
[/code]
But with such a solution, you should be pretty sure of whether the target links are fully processed or not?
Success consists of getting up just one more time than you fall.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

loveojha2 wrote: But with such a solution, you should be pretty sure of whether the target links are fully processed or not?

It will wait for link .....


Thanks,
Anupam
sb_akarmarkar@smart-bridge.co.in
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ray pointed out a very useful fact. Why do all this in the same job. You might want to think about this.
As far as doing a count on hashed file goes, you can access the hashed file, if they were created in your project's account, by using a universe stage. You can run sql queries on it as well. Just do a simple
select count(keycolumn) from "hashedFileName"
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

hi ,

how to do it dsguru , can u be more clear , in the reject file , yes it has
stage tab in the that tab we check the option stage uses filter command,

then right to the path of the file , filter command box is enabled ,

there we have to type wc -l and how do we write the result of wc -l in the reject file with an extra field to get count, i mean what would be the derivation in for the extra field which has get the value of wc -l

could you please explain it more clearly.

Thank you,,
Post Reply