Looking for advice

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

Post Reply
msacks
Premium Member
Premium Member
Posts: 24
Joined: Wed Apr 09, 2008 7:22 am

Looking for advice

Post by msacks »

Greetings all-

I'm looking for advice on how to approach a project I'm just starting to work on.

The project requires that I have two tables, the first table will contain transactional records, the second table will contain summarized records from the transaction table. Once I have the records in the summary table, the requirements also stipulate that for each distinct combination of key values from a record in the summary table, I need to provide 42 metrics or counts of the corresponding transactional records. I need to calculate counts which reflect how many records exist in the transactional table for the month, prior month, year-to-date, rolling twelve months and so forth.

If I weren't using DataStage, I'd most likely write a Stored Procedure to create a recordset of the summary records, and loop over the records to obtain each of the counts from the transactionial table, after all the metrics have been calculated, update the 42 columns in the summary table and move on to the next record in the recordset.

Is this even possible in DataStage? If so, how would I go about this?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You could do the same, if you like, via the Stored Procedure stage. Or via the Aggregator stage (perhaps multiple), though I daresay it may not be all that speedy unless your data is presorted per grouping column(s). Or I would assume that the 'aggregation' could be done using straight sql in your source query, then you'd just need some way to put together these 42 metrics.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Another approach is to write the "keys" (grouping columns) into the summary table, setting the measures to null, zero or some other dummy value, then to update it with the measures in a separate DataStage job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply