|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ASCII to Network byte order |
« View previous topic :: View next topic » |
Author |
Message
|
laddu858 |
Posted: Fri Jun 27, 2014 1:21 pm Post subject: ASCII to Network byte order |
|
|
Novice
Joined: 19 May 2008 Posts: 10
|
I have a requirement to send the acknowledgement to the client in the 4 byte binary length network byte order once the message is successfully received.
How to convert this "00 00 00 06" to network byte order?
can you guys please tell me how to handle this in ESQL.
Thanks in advance. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 27, 2014 1:49 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
How will you know what the correct 'network byte order' is?
Do you understand how 'byte order' affects the serialization of an integer value? If you do, then you should be able to write some ESQL to do the job. If you do not, then how will you test your solution?
FYI, byte order is usually handled by the parser when it automatically converts a message tree into a BLOB. DFDL and MRM will both write integers in a specified byte order. But that might be overkill for your simple scenario. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
laddu858 |
Posted: Fri Jun 27, 2014 2:23 pm Post subject: |
|
|
Novice
Joined: 19 May 2008 Posts: 10
|
Thanks Kimbert.
Do you understand how 'byte order' affects the serialization of an integer value? If you do, then you should be able to write some ESQL to do the job. If you do not, then how will you test your solution?
-- can you please provide some more info on the byte order pls. |
|
Back to top |
|
 |
laddu858 |
Posted: Fri Jun 27, 2014 2:50 pm Post subject: |
|
|
Novice
Joined: 19 May 2008 Posts: 10
|
I figured it out..
DECLARE clength BLOB 6;
SET clength = right(clength,4);
Thanks Kimbert |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jun 28, 2014 4:10 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
No - this is not a training forum. You could easily look up 'byte order' using your favourite search engine.
FYI, your solution will not adjust the byte order. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|