|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to use Binary DataType |
« View previous topic :: View next topic » |
Author |
Message
|
Thameem |
Posted: Thu Jul 11, 2002 9:54 pm Post subject: How to use Binary DataType |
|
|
Newbie
Joined: 03 Jul 2002 Posts: 7
|
We need transformation of data at bit level. Is it possible to use Binary datatype for this purpose and how?
Thanks in Advance.
Thameem |
|
Back to top |
|
 |
kirani |
Posted: Fri Jul 12, 2002 7:59 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Could you post an example of input and output data? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Thameem |
Posted: Sun Jul 14, 2002 11:40 pm Post subject: |
|
|
Newbie
Joined: 03 Jul 2002 Posts: 7
|
Depending on several values in the input, we have to set the bits at appropriate position and construct a binary number. for eg:
we have to construct a binary string like 1101 0001 1101 0001 which occupies 2 digits.
It would be of great help if we can get some example of how to use binary datatype in MRM.
Thanks in Advance
Thameem |
|
Back to top |
|
 |
kirani |
Posted: Mon Jul 15, 2002 12:03 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Well, If you define a field as BINARY into MRM, it will be represented as BLOB (X'......' format). You could use CAST function to convert BLOB into BIT data type, and then use SUBSTRING to extract binary digits only. BIT values are represented in B'1001....' format.
For example, If you define a field into MRM of BINARY data type of length 2 bytes. You could use following code to get Binary digits for that field,
Code: |
DECLARE mybin BIT;
SET mybin = CAST(InputRoot.MRM.BinaryFieldName AS BIT);
DECLARE binstring CHAR;
SET binstring = SUBSTRING(CAST(mybin AS CHAR) FROM 3 FOR 16);
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
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
|
|
|
|