Page 1 of 1

single source record need load two records in the target

Posted: Tue Oct 04, 2005 9:46 am
by arvind
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

Posted: Tue Oct 04, 2005 11:11 am
by ucf007
a transformer with 2 outputs will do the job, selecting the right metadata...

Posted: Tue Oct 04, 2005 3:40 pm
by 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

Posted: Tue Oct 04, 2005 3:52 pm
by alokkum
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
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

Posted: Tue Oct 04, 2005 4:06 pm
by ray.wurlod
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.

Posted: Tue Oct 04, 2005 5:58 pm
by vmcburney
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.

Posted: Tue Oct 04, 2005 9:12 pm
by htrisakti3
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)

Code: Select all

         Hash1          
text --> A C D E    --> sort --> text-out
     --> A B C D E   

Posted: Tue Oct 04, 2005 9:30 pm
by kumar_s
vmcburney wrote: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.
Hi,
what happens if two individual seq stages with append mode... :roll:

regards
kumar

Posted: Tue Oct 04, 2005 11:25 pm
by ray.wurlod
Nothing, except maybe an abort.

Operating system rules prohibit more than one writer to a sequential file.

Posted: Wed Oct 05, 2005 12:19 am
by vmcburney
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.

Posted: Sun Oct 09, 2005 7:56 am
by arvind
Hello All,
Thanks to eveybody who replied my question.

I created two output's where in one link i gave column B as null,
Using funnel stage I created the sequential file with desired output.


Thanks and Regards
Arvind