seq numbers

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
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

seq numbers

Post by karrisuresh »

Hi All


there are 10 columns in my target table,
9 columns are filled from source
and 10th column needs to be filled by number sequence starting from 1

eg for load 1
for 100 records, the 10th column is populated as 1 thorugh 100

eg for load 2
for 100 records, the 10th column is populated as 101 thorugh 200

the job is parallel job

src:table/file
tgt:table

can anyone help me,
thanks in advance

Thanks
Suresh
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sure, but you can help yourself faster by searching.

Essentially what you need to do is as follows (in a job sequence).
  • Determine the current maximum value (use a job).

    Load this somewhere convenient (a file, or the job's user status area).

    Retrieve that value.

    Use that value as a job parameter to provide the starting value of your numeric sequence.

    Use system variables (such as @PARTNUM, @PARTCOUNT) to generate a sequence of unique numbers irrespective of the degree of parallelism in your main job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

Post by singhald »

Suresh,

you can use oracle sequence and use a lookup stage in your job perform sparse lookup on oracle sequence and get the next value each time for each record.
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Something wrong with using the Surrogate Key stage? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Post by karrisuresh »

can you please elaborate it

thanks
suresh
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Post by karrisuresh »

Hi Deepak Can you please elaborate it

thanks
sai
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
Post Reply