single source record need load two records in the target
Moderators: chulett, rschirm, roy
single source record need load two records in the target
Hi,
I want to know how to load 2 records in to the target from single source record.
Eg.
Source columns
A B C D E
Source records
123 AAA 2354 4656 bbb
234 BBC 8762 9876 ddd
Target columns
A B C D E
Target Records
123 2354 4656 bbb
123 AAA 2354 4656 bbb
234 8762 9876 ddd
234 BBC 8762 9876 ddd
In the target I need to load two records for ever source record.
First record of the every target record for the Value A, column B value should be NULL.
Second record of the every target record for the value A is a direct pass through, ie it looks exactly same as source record.
Please help me in writing the above logic.
Thanks in advance
Arvind
I want to know how to load 2 records in to the target from single source record.
Eg.
Source columns
A B C D E
Source records
123 AAA 2354 4656 bbb
234 BBC 8762 9876 ddd
Target columns
A B C D E
Target Records
123 2354 4656 bbb
123 AAA 2354 4656 bbb
234 8762 9876 ddd
234 BBC 8762 9876 ddd
In the target I need to load two records for ever source record.
First record of the every target record for the Value A, column B value should be NULL.
Second record of the every target record for the value A is a direct pass through, ie it looks exactly same as source record.
Please help me in writing the above logic.
Thanks in advance
Arvind
Hi All,
Thanks ucf007,
Eg.
Source columns
A B C D E
Source records
123 AAA 2354 4656 bbb
234 BBC 8762 9876 ddd
Target columns
A B C D E
Target Records
123 2354 4656 bbb
123 AAA 2354 4656 bbb
234 8762 9876 ddd
234 BBC 8762 9876 ddd
I want the out put in single target file with two records with the above logic.
for one source record i need to load two records with the above logic in the same target file.
Thanks in Advance
Arvind
Thanks ucf007,
Eg.
Source columns
A B C D E
Source records
123 AAA 2354 4656 bbb
234 BBC 8762 9876 ddd
Target columns
A B C D E
Target Records
123 2354 4656 bbb
123 AAA 2354 4656 bbb
234 8762 9876 ddd
234 BBC 8762 9876 ddd
I want the out put in single target file with two records with the above logic.
for one source record i need to load two records with the above logic in the same target file.
Thanks in Advance
Arvind
You got a right answer, a transformer with 2 outputs will do the job, selecting the right metadata...
Use 2 links writing to the same dataset
Use 2 links writing to the same dataset
arvind wrote:Hi All,
Thanks ucf007,
Eg.
Source columns
A B C D E
Source records
123 AAA 2354 4656 bbb
234 BBC 8762 9876 ddd
Target columns
A B C D E
Target Records
123 2354 4656 bbb
123 AAA 2354 4656 bbb
234 8762 9876 ddd
234 BBC 8762 9876 ddd
I want the out put in single target file with two records with the above logic.
for one source record i need to load two records with the above logic in the same target file.
Thanks in Advance
Arvind
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are other solutions, but the Transformer stage with two outputs will be the easiest to implement, and is correct. Simply map the columns required on each output using drag and drop. You could do the same with a Copy stage with two outputs.
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: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
If you are writing to a sequential output file you can funnel both your output links back together again. They should have the same column metadata.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Charter Member
- Posts: 36
- Joined: Thu Jun 10, 2004 11:22 pm
looking at your example, you want to:
1. read source fields: A B C D E
2. write to
A C D E
A B C D E
I'd simply read the file twice (2 output links) --> hash (to enable multiple write at the same time)
1. read source fields: A B C D E
2. write to
A C D E
A B C D E
I'd simply read the file twice (2 output links) --> hash (to enable multiple write at the same time)
Code: Select all
Hash1
text --> A C D E --> sort --> text-out
--> A B C D E
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Assuming you have columns A B C D E on both transformer output links where column B is null on the first link you can use the funnel stage to turn it back into a single stream and write it to a sequential file.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn