Page 1 of 1

Sequence number

Posted: Thu May 24, 2007 12:33 pm
by Apotluri
Hi All,

Here is the job design

Seq_file----->Pivot stage----->Transformer----->Oracle_table

I am taking data from Seq file and transform and sending to Oracle_table

There are some fields from cobol copy book which occurs twice in the source and getting populated as Column_A,Col_B,Col_C, FLAG,Col_B_2, Col_C_2 in metadata

By using Pivot stage I am generating second row with columns which are occuring second time

Now, I need to generate a sequence number as below

If the FLAG=1 then generate sequence number as 1
and of the FLAG=2 then generate sequence number as 1 for first row
and generate sequence number as 2 for second row

I tried by using Surrogate Key Generator, but not able to meet the above condition

Any ideas?

Posted: Thu May 24, 2007 3:29 pm
by ray.wurlod
Use stage variables in a Transformer stage to detect change; if there's a change set the counter to 1, if there's no change increment it.