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

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

how to find out howmany records were processed and rejected

Post by sudhakar_viswa »

Hi,

how to find out howmany records were processed and rejected.I want to store this information into database.

Thanks,
sudhakar
i need to know datastage
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Re: how to find out howmany records were processed and rejec

Post by hhh »

do you want to capture job log info for rejected records or actual rejected records ?




sudhakar_viswa wrote:Hi,

how to find out howmany records were processed and rejected.I want to store this information into database.

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

Post by sudhakar_viswa »

Hi,

after the completing the job execution i need to store the howmany records are processed and howmany records are regected into database.

is there any way to capture the information in log files

Thanks,
sudhakar
i need to know datastage
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Post by rwierdsm »

Rob Wierdsma
Toronto, Canada
bartonbishop.com
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

You can write after job subroutine with the help of functions like DSGetLogSummary and DSGetLogSummary,this may useful for what u want to capture.
sudhakar_viswa wrote:Hi,

after the completing the job execution i need to store the howmany records are processed and howmany records are regected into database.

is there any way to capture the information in log files

Thanks,
sudhakar
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can use @INROWNUM and @OUTROWNUM to get that info from within the job. If you want to get that info from outside a job, i suggest you look at DSGetLogInfo() functions, design the job to handle rejects appropriately so that a distinct count can be done on those links.
Regards,
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi DSguru,

How to acheive this.Give me some idea


Thanks,
sudhakar
i need to know datastage
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Recognize the type of rejects and handle them in the transformer itself. Make it go through a link named say 'rejected' to a reject file. So the number of records going through the rejected link will be your reject count and the number of records going through your other link will be your processed count.
How you can handle that?
Well the answer to that question depends upon what you are handling. If its failed key values by lookups you can do inlink.NOTFOUND property. If its data validation process, you can use stage variables. It all depends upon what you are trying to reject.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi DSguru,

I don't want to use the aggregator.Thats why how can i achieve

Thanks,
sudhakar
i need to know datastage
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Why do you want to use the aggregator if you can get that info by @OUTROWNUM. If you have millions of records, the aggregator is going to take a toll on your performance.
But if you insist, have the links go into the aggregator, do a count on the key on those links. That will get you the count.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

DSguru2B wrote:Why do you want to use the aggregator if you can get that info by @OUTROWNUM.
OP didn't want to use the Aggregator stage :wink:

I looked through the links provided by Rob and they pretty much cover the areas you need, to accomplish your task.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi DSGuru,

For each record it will give the @OUTROWNUM.How can i get the last record @OUTROWNUM.If you use the stage variable you can store the @OUTROWNUM.How can i store this information in database

Thanks,
sudhakar
i need to know datastage
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Well, i think you will have to use the aggregator to get the max of @OUTROWNUM to get the link count, if you want to do it within that job. Or the other way is to do a wc -l on the file and get the value.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sudhakar_viswa
Participant
Posts: 85
Joined: Fri Nov 18, 2005 5:35 am

Post by sudhakar_viswa »

Hi DSGuru,

Thanks for your replying.My reqirement is to do everything in one job.And one more thing is i have to update the database.How can i apply wc -l in the same job.

Thanks,
regards,
i need to know datastage
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

The sequential file where you are storing the rejects. Have an output link coming out of it. In the properties, on the stage tab click on stage uses filter commands. In the path provide the path of the file, on the right in the filter command give the command wc -l.
In the output link, specify only one column say count. That will get you the count.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply