Get row number from sequential files

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
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Get row number from sequential files

Post 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.
Edward Yuan
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Post 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.
Edward Yuan
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Sequential file has a option named "Row Number Column" which will generate row numbers starting with 0.
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Post 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.
Edward Yuan
Post Reply