Page 1 of 1

Need help concatenating rows

Posted: Fri Sep 30, 2016 5:35 am
by ssushi
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.

Posted: Fri Sep 30, 2016 6:45 am
by chulett
:?

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.

Posted: Fri Sep 30, 2016 7:18 am
by rkashyap
Also the Subject "Datastage" is quite ambiguous. Can you make it more relevant to the query.

Posted: Fri Sep 30, 2016 7:31 am
by johnboy3
Curious problem.

More information please.
john3

Posted: Fri Sep 30, 2016 7:43 am
by chulett
Let me see if I can help on the subject of the subject. :wink:

Posted: Fri Sep 30, 2016 7:44 am
by ssushi
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.

Posted: Fri Sep 30, 2016 7:48 am
by chulett
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.

Posted: Fri Sep 30, 2016 7:58 am
by ssushi
Hi,

The first row is one full length string and same with the second row too, do not worry about the fields in that.

I just want to combine both these rows into a single row in the output.

Thank You.

Posted: Fri Sep 30, 2016 9:03 am
by chulett
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?