Need help concatenating rows

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ssushi
Participant
Posts: 3
Joined: Fri Sep 30, 2016 4:56 am

Need help concatenating rows

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

Also the Subject "Datastage" is quite ambiguous. Can you make it more relevant to the query.
johnboy3
Premium Member
Premium Member
Posts: 52
Joined: Fri Jun 19, 2015 2:48 pm
Location: Jackson, MS, USA

Post by johnboy3 »

Curious problem.

More information please.
john3
john3
----------------------------------------------------
InfoSphere 8.5.0.2; DataStage 8.5.0.0; OS-RHEL 6.6; DB-Oracle Enterprise Edition 11g (11.2.0.4)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Let me see if I can help on the subject of the subject. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ssushi
Participant
Posts: 3
Joined: Fri Sep 30, 2016 4:56 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ssushi
Participant
Posts: 3
Joined: Fri Sep 30, 2016 4:56 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply