ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportA ROW var(holding JSON) conversion to blob

Post new topicReply to topic
A ROW var(holding JSON) conversion to blob View previous topic :: View next topic
Author Message
anurag.munjal
PostPosted: Sun Aug 20, 2017 12:23 am Post subject: A ROW var(holding JSON) conversion to blob Reply with quote

Voyager

Joined: 08 Apr 2012
Posts: 96

Hello Champions,
Requirement is below:

I have a JSON array coming at MQ input node which is holding a json array.
This input json message, that holds a json array, is storing key value pairs.

now amongst this key value pair, one of the value is a json in itself.

We need to out this inner json message to outputroot as blob which eventually is to be published to IOT.

i have been able to store the inner json in a ROW type variable as i couldnt store in any other type of variables.

So, the question is, how do we convert a ROW type variable into blob??????

Am not exactly sure about ASBITSTREAM, never used it. am going through it, but some guidance here would be really helpful! thanks.

as per below message, basically i want to send as blob the value of Itsvalue per below message.

Thanks

Sample Message:




{
"xxx": "sas",
"aa": "abc",
"attributes": [{
"My_name": "SomeAtt",
"Itsvalue ": {
"aabbcc": {
"hhddll": "contact admin",
"contact admin": "http.smaldj.kjasd.asd.nc"
}
}
}]
}
_________________
- Anurag
------------------------
Be Simple, Be Happy
Back to top
View user's profile Send private message
anurag.munjal
PostPosted: Sun Aug 20, 2017 1:13 am Post subject: 80% solved Reply with quote

Voyager

Joined: 08 Apr 2012
Posts: 96

So,
i tried this:

DECLARE tmp BLOB ASBITSTREAM(EnvironmentRef OPTIONS options CCSID 1208);

the tmp is able to store in blob my required Json, but its storing the variable above the required json too.

as per the sample message if you refer to that, tmp is storing the below in blob (pasting it post conversion:



"My_name": "SomeAtt",
"Itsvalue ": {
"aabbcc": {
"hhddll": "contact admin",
"contact admin": "http.smaldj.kjasd.asd.nc"
}
}


Wheras, what i need is this:
{
"aabbcc": {
"hhddll": "contact admin",
"contact admin": "http.smaldj.kjasd.asd.nc"
}
}




Here,
_________________
- Anurag
------------------------
Be Simple, Be Happy
Back to top
View user's profile Send private message
anurag.munjal
PostPosted: Sun Aug 20, 2017 1:16 am Post subject: Reply with quote

Voyager

Joined: 08 Apr 2012
Posts: 96

forgot to mention, here EnvironmentRef is a reference to Itsvalue per sample message[url][/url]
_________________
- Anurag
------------------------
Be Simple, Be Happy
Back to top
View user's profile Send private message
timber
PostPosted: Sun Aug 20, 2017 12:27 pm Post subject: Reply with quote

Yatiri

Joined: 25 Aug 2015
Posts: 654

Please add a Trace node after the MQInput node and set the Pattern property to ${Root}. In the trace file you will get a detailed listing of the message tree including the data type of every node.

Once you have that, it should be obvious how to solve your problem. If not, feel free to post again (and quote the Trace node output, obviously!).
Back to top
View user's profile Send private message
anurag.munjal
PostPosted: Sun Aug 20, 2017 6:31 pm Post subject: Reply with quote

Voyager

Joined: 08 Apr 2012
Posts: 96

Thanks for your response!

I fixed the issue by using adbitstream function using folder option!

Thankss
_________________
- Anurag
------------------------
Be Simple, Be Happy
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportA ROW var(holding JSON) conversion to blob
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.