row merger
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 236
- Joined: Sun Apr 01, 2007 7:41 am
- Location: Michigan
row merger
i have data IN A SEQUENTIAL FILE LIKE
1|2|3
4|5|6
7|8|9
Now i want to convert this data to 123456789 in a single row.
My job is sequentilal file----->row merger----->sequential file
When i run the job by selecting MULTIPLE LINES my ouput file looks like
1|2|3
4|5|6
7|8|9 (when i checke in output sequential file)
But the output link frin rowmerger gives a count of 1, but still i am able to see 3 rows in output. What is this behaviour. And also if i wnat to concatenate only two columns in each row, how can i do this. What kind of derivaations can i use in Derivation field of Row Merger
1|2|3
4|5|6
7|8|9
Now i want to convert this data to 123456789 in a single row.
My job is sequentilal file----->row merger----->sequential file
When i run the job by selecting MULTIPLE LINES my ouput file looks like
1|2|3
4|5|6
7|8|9 (when i checke in output sequential file)
But the output link frin rowmerger gives a count of 1, but still i am able to see 3 rows in output. What is this behaviour. And also if i wnat to concatenate only two columns in each row, how can i do this. What kind of derivaations can i use in Derivation field of Row Merger
-
- Premium Member
- Posts: 236
- Joined: Sun Apr 01, 2007 7:41 am
- Location: Michigan
Re: row merger
I got rid of delimiters.just4u_sharath wrote:i have data IN A SEQUENTIAL FILE LIKE
1|2|3
4|5|6
7|8|9
Now i want to convert this data to 123456789 in a single row.
My job is sequentilal file----->row merger----->sequential file
When i run the job by selecting MULTIPLE LINES my ouput file looks like
1|2|3
4|5|6
7|8|9 (when i checke in output sequential file)
But the output link frin rowmerger gives a count of 1, but still i am able to see 3 rows in output. What is this behaviour. And also if i wnat to concatenate only two columns in each row, how can i do this. What kind of derivaations can i use in Derivation field of Row Merger
Nou my output data looks like 1|2|34|5|67|8|9. How can i get rid of these pipe delimiters in output
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 9
- Joined: Tue Jan 08, 2008 7:21 am
- Location: Chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a stage variable to accumulate via concatenation and constrain the transformer stage to emit output only every third row.
Code: Select all
Mod(@INROWNUM,3)=0
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 197
- Joined: Sun Jul 15, 2007 11:45 pm
- Location: Prague
Hi,
I used the following design:
seq file ---- transformer-----seq file
My input was like
1|2|3
4|5|6
7|8|9
11|12|13
14|15|16
17|18|19
In the first seq file,
I didn't not specify any end delimiter or field delimiter.
In Transformer,
I used two stage variables for doing this task.
Ist stage variable:(stagevar)
If Mod(@INROWNUM,3) =1 Then DSLink2.INPUT Else If Mod(@INROWNUM,3) =2 Then StageVar:DSLink2.INPUT Else StageVar:DSLink2.INPUT
2nd stage variable:(stagevar1)
Convert("|","", StageVar)
OUTPUT:
123456789
111213141516171819
Hope this helps...
Thanks,
savis
I used the following design:
seq file ---- transformer-----seq file
My input was like
1|2|3
4|5|6
7|8|9
11|12|13
14|15|16
17|18|19
In the first seq file,
I didn't not specify any end delimiter or field delimiter.
In Transformer,
I used two stage variables for doing this task.
Ist stage variable:(stagevar)
If Mod(@INROWNUM,3) =1 Then DSLink2.INPUT Else If Mod(@INROWNUM,3) =2 Then StageVar:DSLink2.INPUT Else StageVar:DSLink2.INPUT
2nd stage variable:(stagevar1)
Convert("|","", StageVar)
OUTPUT:
123456789
111213141516171819
Hope this helps...
Thanks,
savis