Sequence number

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
Apotluri
Premium Member
Premium Member
Posts: 25
Joined: Sun Dec 25, 2005 10:38 pm

Sequence number

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply