surrogate key

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
lathalr
Participant
Posts: 16
Joined: Thu Feb 14, 2013 6:00 am

surrogate key

Post by lathalr »

Hi All,

I am reading two files in CFF stage. After that, generating sequence number using transformer stage with nextsurrogatekey() function. And I need to create two files.

Input data:
A000000000000000000
B000000000000000000
B000000000000000000
B000000000000000000
A000000000000000000
B000000000000000000
A000000000000000000
B000000000000000000

Output data:
File_1:
Seq_number should be :
1
2
3
File_2:
Seq_number:
1
1
1
2
3

I have read the data sequentially in transformer stage. But in 4node, I am not getting the proper result.Do i need to change my logic or is there any other problem??
Thanks in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What exactly was "not proper" about the 4 node results? Would help if you showed them to us. Also, how are you partitioning the data?
-craig

"You can never have too many knives" -- Logan Nine Fingers
lathalr
Participant
Posts: 16
Joined: Thu Feb 14, 2013 6:00 am

Post by lathalr »

Hi Chulett,

Thanks for ur reply.
I need to create two output files as mentioned. File_1 is correct that is the output value is 1,2,3. But the file_2 is like 0,2,3,1,0. But for the single node or 2node, the output is perfect. I am doing any partitioning inside my job. I am reading the data sequentially in transformer. While running, I am using 4node config(environmental variable : APT_Config_file)
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Does your job contain stages running in parallel mode after the transformer? If so, DataStage partitioning the data,most likely with RoundRobin paritioning. If you do nothing to control the order the records are written to the output, the order is at the mercy of when a block of records arrives at the output writer.

You can run the entire job in sequential mode or sort and collect the records in the order you desire before they are written to the output files.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
lathalr
Participant
Posts: 16
Joined: Thu Feb 14, 2013 6:00 am

Post by lathalr »

Thanks to all..The problem is resolved now. Actually the problem is with my input files. I have read two files, so DS is reading the file in parallel mode eventhough in transformer the execution mode is sequential. I am not sure about the problem. But now I have concatenated the input files and read through CFF stage. Now the sequence number generation is working fine.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Remember to mark the topic as resolved!

Regards,
- james wiles


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