Page 1 of 1

Get row number from sequential files

Posted: Mon Feb 26, 2007 7:28 pm
by Yuan_Edward
My job is required to get the row number for the rejected rows in order to link them back to the sequencial file. But for my understanding, the data is partitioned after the sequencial file is read into DataSet and passing to the next stage.

I probably can get the @INROWNUM and @PARTITIONNUM in a transformer stage, but they are useless.

Someone suggests that I run the transformer stage in sequencial...it works but has impacts to the job performance.

I was also thinking to add another column ROWNUMBER into the file by OS commands...but I would prefer a DataStage solution.

I tried to do a search but didn't get an answer. Can anyone here give me any ideas?

Thank you.

Posted: Mon Feb 26, 2007 7:31 pm
by DSguru2B
Add another column that has a running number. This way when it gets rejected, you will have the row number right there with the row.

Posted: Mon Feb 26, 2007 7:33 pm
by Yuan_Edward
Thank you for prompt reply. Could you please suggest where I can add the running number column? In sequencial file or transfer stage?
DSguru2B wrote:Add another column that has a running number. This way when it gets rejected, you will have the row number right there with the row.

Posted: Mon Feb 26, 2007 7:34 pm
by balajisr
Sequential file has a option named "Row Number Column" which will generate row numbers starting with 0.

Posted: Mon Feb 26, 2007 7:37 pm
by Yuan_Edward
:oops: I found that option. Thanks. Next time I should do more research before posting.
balajisr wrote:Sequential file has a option named "Row Number Column" which will generate row numbers starting with 0.