Need help concatenating rows
Moderators: chulett, rschirm, roy
Need help concatenating rows
Hi All,
I have an input in the following format,
It consist of two rows.
1st Row
{"cus_no":[{"cus_no":"855","Payment":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]}
2nd Row
{"cus_no":[{"cus_no":"955","Payments":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]}
I want to concatenate two rows data into one row. I have used transformer and tried with sample data like numbers and strings. But, it is not working for the above input.
Please post as soon as possible.
Thank You.
I have an input in the following format,
It consist of two rows.
1st Row
{"cus_no":[{"cus_no":"855","Payment":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]}
2nd Row
{"cus_no":[{"cus_no":"955","Payments":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]}
I want to concatenate two rows data into one row. I have used transformer and tried with sample data like numbers and strings. But, it is not working for the above input.
Please post as soon as possible.
Thank You.
Unfortunately, that's not really enough information for anyone to help without guessing. What does 'concatenate two rows data into one row' mean, exactly, in this context? I have no idea what your expected output would look like, what you've tried in a transformer nor what 'not working' means.
So help us help you, clarify your issue for us.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi All,
Sorry for the inconvenience.
I want my output to be like this:
{"cus_no":[{"cus_no":"855","Payment":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]} {"cus_no":[{"cus_no":"955","Payments":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]}
Thank You.
Sorry for the inconvenience.
I want my output to be like this:
{"cus_no":[{"cus_no":"855","Payment":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]} {"cus_no":[{"cus_no":"955","Payments":[
{"token":"123","ex":"01","type":"Visa","CreditCard":"false"},
{"token":"987","ex":"02","type":"Disc","CreditCard":"false"},
{"token":"234","ex":"03","type":"ME","CreditCard":"true"}]
}]}
Thank You.
Any chance you can explain your output requirements in words?
And this input... is it all one string and you need to parse it? Separate fields? For the latter, which bits are the fields? Better to have too many details than too few, then we can stop all this back-and-forth and get on with the helping part.
And this input... is it all one string and you need to parse it? Separate fields? For the latter, which bits are the fields? Better to have too many details than too few, then we can stop all this back-and-forth and get on with the helping part.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Okay... still more questions but high level you just need to concatenate the two strings and the operator is ":" in DataStage so "String_A : String_B" does the dirty deed. But then I assume you already know that and the issue is bringing the two rows together. Yes?
Since we're still in the pulling teeth mode, do you literally only have TWO rows to put together or do you have a source (file? database? magic lamp?) with multiple records and you need to do this with every set/pair of 'two records' coming in from the source?
Since we're still in the pulling teeth mode, do you literally only have TWO rows to put together or do you have a source (file? database? magic lamp?) with multiple records and you need to do this with every set/pair of 'two records' coming in from the source?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers