SKG stage related question

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
devsonali
Premium Member
Premium Member
Posts: 155
Joined: Sun Mar 18, 2007 2:31 pm

SKG stage related question

Post by devsonali »

Hello Gurus

I have a requirement
I have multiple columns
Column1 Column2
A A1
A A2
A A3
B B1
B B2
so on
I was trying to get key columns for both as follows

Column1 Column2 KeyforColumn1 KeyforColumn2
A A1 1 1
A A2 1 2
A A3 1 3
B B1 2 1
B B2 2 2

So on

Can you please tell me how to use SKG stage to achieve this ?
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

It would be difficult to get the results indicated in your example with SKG in a single job due to the fact you are reusing key values for column 2. SKG is all about generating unique values.

Use NextSurrogateKey() function in a transformer for each input column, rather than the SKG stage, as you can control when a new SK is created for a column--when the column value changes. See the documentation in the Parallel Job Developer's Guide for information on how to use the function and set the transformer's Surrogate Key options.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply