How to split a single row of record in to two row of output
Moderators: chulett, rschirm, roy
How to split a single row of record in to two row of output
Hi Gurus,
I am having a problem in spliting a single row of records in to 2 output rows
eg:
Input:
cust id Name Lastname age
1 Prab raj 23
2 sam rob 24
output:
Custid Name Lastname
Custid age
1 Prab Raj
1 23
2 Sam rob
2 24
Can any one suggest me which stage to choose to do this function
I am having a problem in spliting a single row of records in to 2 output rows
eg:
Input:
cust id Name Lastname age
1 Prab raj 23
2 sam rob 24
output:
Custid Name Lastname
Custid age
1 Prab Raj
1 23
2 Sam rob
2 24
Can any one suggest me which stage to choose to do this function
There are several ways of doing it. Use Transformer stage and extend two links. One with "Cust id Name Lastname" and other with "Cust id Name age".
You can use Link Collector stage to merge it or you can directly write it into tow seperate sequential file stage, one with Append option. You can sort based on Cust id if required.
You can use Link Collector stage to merge it or you can directly write it into tow seperate sequential file stage, one with Append option. You can sort based on Cust id if required.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Welcome Aboard
You can do a similar thing if your on px job except that you wont have a link collector to collect it. In that case, pass an after job subroutine ExecDOS command to concatenate the two files and sort on id
Something like
I supplied unix commands because you are using px on windows which has MKS Toolkit shipped with the product.
You can do a similar thing if your on px job except that you wont have a link collector to collect it. In that case, pass an after job subroutine ExecDOS command to concatenate the two files and sort on id
Something like
Code: Select all
cat file1 file2 | sort > file 3
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Err... two links writing to the same file at the same time, one with the append option? No can do, my friend. If you could manage that in a serial fashion where the overwrite link completes before the append link starts, only then is that an appropriate answer.kumar_s wrote:By using Append option in one file will take care of this.
You may not be able to have 'multiple inputs' but you can write to two separate files and then combine them after job, or in another job depending on the nature of the 'combining' that needs doing.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
There is a stage called "Link Collector", may be the project that you are using are not customized for that stage. You can do it by Customizing from pallet. But the input for this stage should be of same metadata.
So if you are going to use this, you need to make the file as same metadata on both the link. You may need to concatinate the fields. Or you can use the other approach.
So if you are going to use this, you need to make the file as same metadata on both the link. You may need to concatinate the fields. Or you can use the other approach.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Funnel Stage needs same metadata from both streams to work. Dsguru has given clear description, follow that post.prnath78 wrote: Input ->TX->(link1 with Custid Name Lastname )->| -> funnel(custid)-o/p
->(link2 with Custid age ) ->|
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
Re: How to split a single row of record in to two row of out
Sorry.us1aslam1us wrote:Funnel Stage needs same metadata from both streams to work. Dsguru has given clear description, follow that post.
I agree with you.
The greatest religion is to be true to your own nature. Have faith in yourselves!. ..swami vivekanandha
I tried the following scenario.
Two link from Transformer, both to the same sequential file stable, one as Overwrite and other as Append. Interestingly I didn't any error or warnings. And output is as expected!!!
Note : In Server Job.
Two link from Transformer, both to the same sequential file stable, one as Overwrite and other as Append. Interestingly I didn't any error or warnings. And output is as expected!!!
Note : In Server Job.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'