Row count generation
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 28
- Joined: Mon Nov 06, 2006 5:44 am
- Location: chennai
Row count generation
Hi,
We have a requirement in which we need to seperate the 10th record from a file and process it separately. Is there any way to filter the 10th record alone from a file using any stages by checking the rowcount . Any help is appreciated. Thanks
We have a requirement in which we need to seperate the 10th record from a file and process it separately. Is there any way to filter the 10th record alone from a file using any stages by checking the rowcount . Any help is appreciated. Thanks
J.Ithayavino
Use "@INROWNUM" in a transform stage. Easiest if you change your job to use just one node or work sequentially in that stage.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
This may be what you want in the contraint as both said:
Code: Select all
Not(Mod(@INROWNUM,10))
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Keep in mind (and in your design) the consequences of parallel execution. Is "the tenth record on each node" what you require, or "the tenth line from a sequential file (being processed sequentially)" what you require?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are many ways,
If you use transformer stage then,
you either use @INROWNUM or OUTROWNUM, based on the requirement, if you want to take out 10th record which got processed to the target the use @OUTROWNUM or if you want to take out 10th record from the file then use @INROWNUM
Use @OUTROWNUM=10 in the constraint of the transformer stage.
you can you use head -11 <filename> also. Use this if your source file has header record init.
tks.
If you use transformer stage then,
you either use @INROWNUM or OUTROWNUM, based on the requirement, if you want to take out 10th record which got processed to the target the use @OUTROWNUM or if you want to take out 10th record from the file then use @INROWNUM
Use @OUTROWNUM=10 in the constraint of the transformer stage.
you can you use head -11 <filename> also. Use this if your source file has header record init.
tks.
with regards,
tsn
tsn