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 Previous  1, 2
 Binary, Packed Decimal, and Character in One Input Message « View previous topic :: View next topic » 
Author Message
jefflowrey
PostPosted: Tue Jul 15, 2003 12:08 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You need to include a CCSID parameter in your cast command.

SET "OutputRoot"."MRM"."CARDHOLDER_NO" = CAST(SUBSTRING(SEGMENT FROM 43 FOR 10) as CHARACTER CCSID InputRoot.Properties.CodedCharSetId);
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 15, 2003 12:10 pm    Post subject: Reply with quote

Jedi Knight

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

got it!
What you need to do is first read your input message as BLOB and then use following code in a compute node.

Code:

SET OutputRoot.MRM.CARDHOLDER_NO = SUBSTRING(CAST(InputRoot."BLOB"."BLOB" AS CHAR CCSID InputRoot.Properties.CodedCharSetId) FROM 20 FOR 5);

will return you 02-26.

Hope this helps.
_________________
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 12:36 pm    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

After trying the statement, this is what I received in the Trace:

2003-07-15 15:28:00.372000 2984 UserTrace BIP2537I: Node 'TRANS_FILE_PUB_SUB.Compute1': Executing statement 'SET OutputRoot.MRM.CARDHOLDER_NO = CAST(SUBSTRING(SEGMENT FROM 43 FOR 10) AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId);' at (59, 2).
2003-07-15 15:28:00.372000 2984 UserTrace BIP2538I: Node 'TRANS_FILE_PUB_SUB.Compute1': Evaluating expression 'CAST(SUBSTRING(SEGMENT FROM 43 FOR 10) AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId)' at (59, 43).
2003-07-15 15:28:00.372000 2984 UserTrace BIP2538I: Node 'TRANS_FILE_PUB_SUB.Compute1': Evaluating expression 'SUBSTRING(SEGMENT FROM 43 FOR 10)' at (59, 4.
2003-07-15 15:28:00.372000 2984 UserTrace BIP2538I: Node 'TRANS_FILE_PUB_SUB.Compute1': Evaluating expression 'SEGMENT' at (59, 5.
2003-07-15 15:28:00.372000 2984 UserTrace BIP2539I: Node 'TRANS_FILE_PUB_SUB.Compute1': Finished evaluating expression 'SUBSTRING(SEGMENT FROM 43 FOR 10)' at (59, 4. This resolved to 'SUBSTRING('X'b1100c303933313130303130303534323030322d30322d323630303a30303a303130393331313030303037353030303030303030303030303030303030303030303032353131303031303030303030302030303031343139203430303235303638200000'' FROM 43 FOR 10)'. The result was ''30322d3236''.
2003-07-15 15:28:00.372000 2984 UserTrace BIP2538I: Node 'TRANS_FILE_PUB_SUB.Compute1': Evaluating expression 'InputRoot.Properties.CodedCharSetId' at (59, 101).
2003-07-15 15:28:00.372000 2984 UserTrace BIP2539I: Node 'TRANS_FILE_PUB_SUB.Compute1': Finished evaluating expression 'CAST(SUBSTRING(SEGMENT FROM 43 FOR 10) AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId)' at (59, 43). This resolved to 'CAST('30322d3236' AS CHARACTER CCSID 437 )'. The result was ''30322d3236''.

This is what I received in the Trace Node

(0x1000021)MRM = (
(0x3000000)CARDHOLDER_NO = '30322d3236'
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Jul 15, 2003 1:01 pm    Post subject: Reply with quote

Jedi Knight

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

Did you try above code?
The treace does not look correct for the code mentioned in my earlier post. Please try that code.
_________________
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 1:31 pm    Post subject: Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

I finally realize what I was doing wrong! The code that you sent,

Code:
SET OutputRoot.MRM.CARDHOLDER_NO = SUBSTRING(CAST(InputRoot."BLOB"."BLOB" AS CHAR CCSID InputRoot.Properties.CodedCharSetId) FROM 20 FOR 5);][


did work. So, I attempted to modify if and perform the CAST on a variable that I assigne the contents of part of the BLOB

Code:
SET OutputRoot.MRM.CARDHOLDER_NO = SUBSTRING(CAST(SEGMENT AS CHAR CCSID InputRoot.Properties.CodedCharSetId) FROM 20 FOR 5);]


not realizing that I had declared SEGMENT as a CHARACTER initially! As soon as I changed the declaration, everything was fine!

Thanks again! (This time I really mean it, it works!)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 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.