Page 1 of 1

surrogate key

Posted: Wed Mar 20, 2013 7:13 am
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.

Posted: Wed Mar 20, 2013 7:29 am
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?

Posted: Wed Mar 20, 2013 7:50 am
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)

Posted: Wed Mar 20, 2013 8:35 am
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,

Posted: Thu Mar 21, 2013 3:27 am
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.

Posted: Thu Mar 21, 2013 9:25 am
by jwiles
Remember to mark the topic as resolved!

Regards,