Input record 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

vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Can you try with this

( (@INROWNUM - 1) * @NUMPARTITIONS + @PARTITIONNUM + 1)
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

If your input is sequential file, then you can set Row Number column option in Properties to get the sequential number.
You are the creator of your destiny - Swami Vivekananda
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

vinothkumar wrote:Can you try with this

( (@INROWNUM - 1) * @NUMPARTITIONS + @PARTITIONNUM + 1)
Thanks Vinoth! But no luck with this as well. When I use this, The sequence number starts with 1 but gives a count of 177. Actual is 175. I will try with some other set of records and let you know.
Arun
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

anbu wrote:If your input is sequential file, then you can set Row Number column option in Properties to get the sequential number.
Thanks Anbu. My source is most of the time is an EBCDIC file or a Dataset.
Arun
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

anbu wrote:If your input is sequential file, then you can set Row Number column option in Properties to get the sequential number.
I just tried this by keeping a sequential file as a source. But the sequence number starts with 0 for every partition. :(
Arun
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

arunkumarmm wrote:
anbu wrote:If your input is sequential file, then you can set Row Number column option in Properties to get the sequential number.
I just tried this by keeping a sequential file as a source. But the sequence number starts with 0 for every partition. :(
Yes Row number starts with zero. But How do you get different partition in sequential file?
You are the creator of your destiny - Swami Vivekananda
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Does your input file have a header record or column headers in the first sequential record? That might be why your maximum row number is greater than the number of data records. That's a guess, because when the documentation says "column header records are ignored during processing" it doesn't go into detail for this situation.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

arunkumarmm wrote:
vinothkumar wrote:Can you try with this

( (@INROWNUM - 1) * @NUMPARTITIONS + @PARTITIONNUM + 1)
Thanks Vinoth! But no luck with this as well. When I use this, The sequence number starts with 1 but gives a count of 177. Actual is 175. I will try with some other set of records and let you know.
Your count and actual matches only if you have equal number of rows in all the partitions
You are the creator of your destiny - Swami Vivekananda
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

anbu wrote:
arunkumarmm wrote:
anbu wrote:If your input is sequential file, then you can set Row Number column option in Properties to get the sequential number.
I just tried this by keeping a sequential file as a source. But the sequence number starts with 0 for every partition. :(
Yes Row number starts with zero. But How do you get different partition in sequential file?
I'm not sure about this. But I have 4 partitions and I get 4 different sequence numbers starting from 0
Arun
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

FranklinE wrote:Does your input file have a header record or column headers in the first sequential record? That might be why your maximum row number is greater than the number of data records. That's a guess, because when the documentation says "column header records are ignored during processing" it doesn't go into detail for this situation.
I just have a test file created by me. It doesnt have the header or a trailer.
Arun
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

anbu wrote:
arunkumarmm wrote:
vinothkumar wrote:Can you try with this

( (@INROWNUM - 1) * @NUMPARTITIONS + @PARTITIONNUM + 1)
Thanks Vinoth! But no luck with this as well. When I use this, The sequence number starts with 1 but gives a count of 177. Actual is 175. I will try with some other set of records and let you know.
Your count and actual matches only if you have equal number of rows in all the partitions
Yes. I got it now. This is the reason! Thanks Anbu. But is there a way to over come this?
Arun
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Run the parallel transformer in sequential way and use @INROWNUM
You are the creator of your destiny - Swami Vivekananda
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

Run the parallel transformer in sequential way and use @INROWNUM
Seriously? :roll:
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

mhester wrote: Seriously? :roll:
I have done it in the past successfully with low volume of the data.
Kris

Where's the "Any" key?-Homer Simpson
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

Agreed, but the answer should have clarified that point. There are many times that a single node configuration is preferable to a multi node, or running an operator in the sequential mode, but without knowing a bit more from the op the answer needs to be qualified.
Post Reply