Counter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Counter

Post by Munish »

Hi There,
Scenario
My records look like
AccountNo. BillNo. Item_id
1 1 167
1 1 168

1 2 6
1 2 7
1 2 8

2 1 6

Now, I need to record log for record count
By account, Bill, RecordCount
so it will be
Accountno Billno RecordCount
1 1 2
1 2 3
2 1 1

I searched thru the DSX, there were articles about
KeyMgtGetNextValue
SDKSequences
RowProcGetPreviousValue

Please advice
1. Are these datastage defined functions
2. If yes, how to use them (I tried to use them but I get error saying define variable)
3. If No, How to do this.

Thanks and regards,
Munish
MK
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You are posting in the parallel forum, if you are using parallel jobs you will need to go to the FAQ forum for the entry on creating a parallel counter within a Transformer. The routines you listed cannot be used in parallel jobs.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

What is the source of this data?

If it is a table, you can achieve your results by writing a simple query.

Code: Select all

select AccountNo, BillNo, count (Item_id) RecordCount
from TABLE 
group by AccountNo, BillNo
If a file, you can write it to a table and do the same.
Of course there are can be other options too.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Post by Munish »

I am reading from sequential file.
The load is so high (200 gig) that it has to done on fly.

This information will be written to log file.

Any suggestions??

Thx,
Munish
MK
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

vmcburney wrote:You are posting in the parallel forum, if you are using parallel jobs you will need to go to the FAQ forum for the entry on creating a parallel counter within a Transformer. The routines you listed cannot be used in parallel jobs.
You did not answer Vincent's questions, your answers will be based on it.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Click here to go to the post that vincent is talking about. If you can partition your data on the group (AccountNo+BillNo) then you can get a counter set up by using two stage variables. Read that post, it will get your work done.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Post by Munish »

Thanks All,
You guys are wonderful.
Regards,
Munish
MK
Post Reply