How to keep the record order with Surrogate key generator

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
NSIT-DVP-01
Premium Member
Premium Member
Posts: 46
Joined: Wed May 16, 2007 1:54 am
Location: Paris
Contact:

How to keep the record order with Surrogate key generator

Post by NSIT-DVP-01 »

Hi,

I want to add a sequence to records in a flat file with surrogate key generator.
My job design is simple:

Code: Select all

sequential file --> surrogate key generator --> sequential file 
My input file is:

Code: Select all

aaa
bbb
ccc
ddd
eee
and what I want to get as the output is:

Code: Select all

1 aaa
2 bbb
3 ccc
4 ddd
5 eee
With surrogate key generator, I can realize that. But the problem is that the order of output is not certain. It's random. What I get finally is:

Code: Select all

1 bbb
2 aaa
3 ddd
4 ccc
5 eee 
I have tried to set the execution mode of surrogate key generator stage as sequential. But when I run the job, there is an error saying:

Code: Select all

Surrogate_Key_Generator_22: Error when checking operator: Input data set on port 0 has a partition method, but the operator is not parallel.
Can anybody give me a suggestion on this issue?
Thanks in advance!

NSIT
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Run the job on one node.
-craig

"You can never have too many knives" -- Logan Nine Fingers
NSIT-DVP-01
Premium Member
Premium Member
Posts: 46
Joined: Wed May 16, 2007 1:54 am
Location: Paris
Contact:

Post by NSIT-DVP-01 »

Run the job on one node.

_________________
-craig

All in all, you're just another brick in the wall... and sometimes you're crushed between them.
Thanks chulett, and can you give me a suggestion for how to realize that?

regards
NSIT
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The number of nodes is an element of the config file you use with the job. One would typically have multiple configurations to choose from, add $APT_CONFIG_FILE to the job and override it to point to a one-node config.
-craig

"You can never have too many knives" -- Logan Nine Fingers
NSIT-DVP-01
Premium Member
Premium Member
Posts: 46
Joined: Wed May 16, 2007 1:54 am
Location: Paris
Contact:

Post by NSIT-DVP-01 »

The number of nodes is an element of the config file you use with the job. One would typically have multiple configurations to choose from, add $APT_CONFIG_FILE to the job and override it to point to a one-node config.
Thanks for your reply!
Post Reply