Page 1 of 1

How to get the sequence number in datastage

Posted: Wed Feb 18, 2004 12:58 pm
by bunu1977
Hi,
I am trying to get a sequential number in datastage.For example if I have 100 rows in my source, the couner column should contain 1 to 100.
How to do it in datastage?

Regds,
DD

Re: How to get the sequence number in datastage

Posted: Wed Feb 18, 2004 1:09 pm
by raju_chvr
Do you need the row number or a number that has to be generated for Surrogate key which is unique every time you run this job and insert data into DW.

for the latter: keyMgtGetNextValue('<key>') shld be used.

Re: How to get the sequence number in datastage

Posted: Wed Feb 18, 2004 1:42 pm
by bunu1977
Thanks,

I have got it using @INROWNUM function.

Regds,
Dilip

Re: How to get the sequence number in datastage

Posted: Wed Feb 18, 2004 1:52 pm
by raju_chvr
that is right for the row number coming into the Transformer.

Posted: Wed Feb 18, 2004 3:02 pm
by ray.wurlod
@OUTROWNUM may be a better choice.

If you later add constraints to your Transformer stage, you will get gaps in the number sequence (which may not matter if they are only being used for uniqueness).

@INROWNUM counts the rows coming in to a Transformer stage.
@OUTROWNUM counts the rows leaving a Transformer stage.