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 Index » WebSphere Message Broker (ACE) Support » Binary, Packed Decimal, and Character in One Input Message

Post new topic  Reply to topic Goto page 1, 2  Next
 Binary, Packed Decimal, and Character in One Input Message « View previous topic :: View next topic » 
Author Message
jeasterl
PostPosted: Mon Jul 14, 2003 6:52 am    Post subject: Binary, Packed Decimal, and Character in One Input Message Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

I have an inbound message to WMQI that consists of three types of data:

Binary, the first element in the string
Packed Decimal, the second element in the string
Character Data, the remaing data

The first element indicates what kind of data is coming in. The packed data indicates how long the string is going to be. And the remaining data is character data that needs to be parsed.

The packed data might look something like this (in hex)

100C

I need to know how to construct my MRM, either TDS or CWF, to accept the incoming data in the MQInput Node so that I can parse the data. I have set the first element to BINARY using the TDS, and that seems to work fine. However, I have not been able to successfully parse the incoming packed decimal fields.

Thanks in advance!
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Jul 14, 2003 9:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Try modeling your message using CWF wire format. For COMP-3 field, Under CWF tab, set Physical Type to Packed Decimal, also set the length of this field corectly.
Now, vreate Another element of Type STRING, whose length depends on COMP-3 field. You need to set the length in Length Value Of field under CWF tab for this string element.
_________________
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
View user's profile Send private message Visit poster's website
jeasterl
PostPosted: Mon Jul 14, 2003 10:08 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

I will try that annd let you know what comes of it. Thanks!
Back to top
View user's profile Send private message
jeasterl
PostPosted: Mon Jul 14, 2003 10:42 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

Okay, I attempted to create an element of type INTEGER. Under the CWF, I specified that the Physical Format was "Packed Decimal" and passed the data into the element.

The incoming data was '0x100c' and this was error that I received:

ConversionException BIP5505E: Data conversion failed: data invalid. Type of data being read: packed decimal, no sign found , data: 0x100c; A data conversion during reading or writing of a message failed because the input data was invalid for the output data type.

Under Signed, I tried both Yes and No and received the same error.

Any thoughts?
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Jul 14, 2003 12:43 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

where are you getting your input data from? What is the CCSID and Encoding of the input message? What is your PIC clause of the input Packed Decimal field? Is it PIC 9(2) COMP-3?
_________________
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
View user's profile Send private message Visit poster's website
jeasterl
PostPosted: Tue Jul 15, 2003 8:31 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

I was able to parse the message without the use of the MRM. It was a little more work than I wanted to do, but it works.

The only question I have now is, since the incoming message was a BLOB and now I want to cast it as a character. How would I go about doing that within the Compute Node? All I am getting now is numbers. I tried to cast the incoming data from the previous Compute Node as CHARACTER, but that does nothing.

Is there something more that needs to be done?
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 15, 2003 8:45 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Try using CAST function with CCSID option to convert incoming BLOB message into CHAR format.
_________________
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
View user's profile Send private message Visit poster's website
jeasterl
PostPosted: Tue Jul 15, 2003 8:53 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

I tried that, using this statement:

SET "OutputRoot"."MRM"."TRAN_AMT" = CAST(InputRoot.XML.Message.b1.TRAN_AMT as CHARACTER CCSID 819 ENCODING 546);

and received the same output as the input. The data within the XML tags was initially cast as BLOB earlier.
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 15, 2003 8:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Could you post the data that is coming into your XML field? And the type of your MRM element.
_________________
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
View user's profile Send private message Visit poster's website
jeasterl
PostPosted: Tue Jul 15, 2003 9:02 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

The data that is coming into the field is 00054 (ASCII) and 30303534 (HEX).
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 15, 2003 9:41 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

So if you assign this data to the MRM field you should get 00054. What value are you expecting into this MRM field?
_________________
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
View user's profile Send private message Visit poster's website
jeasterl
PostPosted: Tue Jul 15, 2003 9:57 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

Actually, that did work. In the previous note that I sent, I was still attempting to write it to XML.

Thank you for all of your help!!!!!!!
Back to top
View user's profile Send private message
jeasterl
PostPosted: Tue Jul 15, 2003 10:21 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

Sorry about that, Kirani. I jumped the gun. That did not work. The element is defined as a STRING and I am receiving the same data. Should it be defined as something else?
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 15, 2003 10:30 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Ok, let me understand this first!
You have a MRM element (TRAN_AMT), which is defined as STRING and you want to assign data from your input XML message (XML.Message.b1.TRAN_AMT) to it?
If this is the case then if you assign input XML element to this MRM element, it should work fine. Don't use CAST function.
Code:

SET OutputRoot.MRM.TRAN_AMT = InputRoot.XML.Message.b1.TRAN_AMT;


Please correct me if I did not understand your problem.
_________________
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
View user's profile Send private message Visit poster's website
jeasterl
PostPosted: Tue Jul 15, 2003 11:17 am    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

I am receiving a string of data similar to the data listed below:

± 0931100100542002-02-2600

This is the hex representation of the data:

B1100C303933313130303130303534323030322D30322D32363030

and I would like to, for example parse the '02-26 from this string. However, each time I try to CAST the incoming data as character using this statement:

SET "OutputRoot"."MRM"."CARDHOLDER_NO" = CAST(SUBSTRING(SEGMENT FROM 43 FOR 10) as CHARACTER);

This is the data that is assigned to the MRM element:

30322d3236

I would like to get '02-26'
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Binary, Packed Decimal, and Character in One Input Message
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.