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 » Casting Error after message comes from SAPInput Node

Post new topic  Reply to topic
 Casting Error after message comes from SAPInput Node « View previous topic :: View next topic » 
Author Message
alethea
PostPosted: Tue Jul 09, 2013 10:13 am    Post subject: Casting Error after message comes from SAPInput Node Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

Hello all,
Could you please help resolve this issue.
I have a message coming fine from SAP via adapter to SAPInput Node.

1)SET BL_IdocData = CAST(InputRoot.DataObject.NS_sapGenObj:SapGenericIDocObject.IDocStreamData AS BLOB CCSID 1208);
2)SET CH_IdocData = CAST(BL_IdocData AS CHARACTER CCSID 1208 ENCODING 1208);

(1) executes fine.
I am getting cast exception in (2) when it Casts iDoc to Character. Here is the exception detail:
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlTypeCast.cpp
Line:INTEGER:260
Function:CHARACTER:SqlTypeCast::evaluate
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2521
Text:CHARACTER:Error while casting

Please let me know if I can provide any further information on this.
Many Thanks.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Jul 09, 2013 10:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Ken - "Hi ya Barbie - wanna go for a ride?"

You can't do what you are trying to do with IDOC structures. The first structure is the Control Structure which is a complex element 524 bytes long that contains a fixed set of SAP-defined simple elements. One or more Data Structures follow. Each DD is a complex element 1063 bytes long that contains a fixed set of SAP-defined simple elements that occupies 63 bytes, followed by 1000 bytes of user-defined segment data.

Use the IDOC parser then serialize the Logical Message Tree to the desired bitstream format, possibly using RootBitStream function on OutputRoot.XMLNSC.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
alethea
PostPosted: Tue Jul 09, 2013 10:48 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

I have parsed the incoming msg by DataObject and provided the generic msgset that I created using Generic iDoc.

I can see the following tree with data coming out of SapInput Node fine.

--DataObject
-----SapGenericIdocObject
------------SapTransactionId
------------IDocStreamData
------------IDocType

Am I missing something. Thanks.
Back to top
View user's profile Send private message
alethea
PostPosted: Tue Jul 09, 2013 10:53 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

Here is the exception that I am getting:

Code:
RecoverableException
File:CHARACTER:/build/S700_P/src/DataFlowEngine/ImbRdl/ImbRdlTypeCast.cpp
Line:INTEGER:260
Function:CHARACTER:SqlTypeCast::evaluate
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2521
Text:CHARACTER:Error while casting
Insert
Type:INTEGER:5
Insert
Type:INTEGER:5
Text:CHARACTER:3.21
Insert
Type:INTEGER:5
Text:CHARACTER:X'4544495f44433430202030313030303030303030303
032313933303236363230203330313220205348504d4e54303520202020
2020202020202020202020202020202020205a453145444c39202020202
02020202020202020202020202020202020205348504d4e542020202020
20202020202020202020202020202020202020202020202020202020202
02020202020202020534150475251202020204c532020475251434c4e54
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jul 09, 2013 10:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So it says "BIPmsgs", which means you're at least at v8.

1208 is not a valid Encoding value.
Back to top
View user's profile Send private message
alethea
PostPosted: Tue Jul 09, 2013 11:03 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

Hi Jeff,
Could you please tell me what encoding value should I provide.
Thanks.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jul 09, 2013 11:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'd remove it entirely.

None of the data you're dealing with is numeric, so Encoding is irrelevant.

I'm also not sure you should be using CAST like this. I suspect you're trying to do something that ASBITSTREAM is better suited for (which is what lancelotlinc said), or that you're CASTING a BLOB into a BLOB.
Back to top
View user's profile Send private message
alethea
PostPosted: Tue Jul 09, 2013 11:24 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

Hi Jeff,

I used Asbitstream as well in following way:

SET BL_IdocData = ASBITSTREAM(InputRoot.DataObject.NS_sapGenObj:SapGenericIDocObject.IDocStreamData ,1208,1208);
SET CH_IdocData = CAST(BL_IdocData AS CHARACTER CCSID 1208 ENCODING 1208);

I got this error msg in first line where ASBITSTREAM is used.
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:5010
Text:CHARACTER:XML Writing Errors have occurred
ParserException
File:CHARACTER:/build/S700_P/src/MTI/MTIforBroker/GenXmlParser4/ImbXMLNSCWriter.cpp
Line:INTEGER:241
Function:CHARACTER:ImbXMLNSCWriter::writeBuffer
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:5031
Text:CHARACTER:No root element was found while writing the XML message.

I tried to run it without ENCODING as well, getting same Casting Exception.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Jul 09, 2013 11:32 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You need to study the InfoCentre more closely. Look at RootBitStream option. And you cannot do what you are trying to do in two lines.

You need to (1) parse the IDOC first using the IDOC parser, (2) serialize that data into a suitable output bitstream, then (3) construct an XMLNSC Logical Message Tree that you want to display the info in a flat XML structure.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Tue Jul 09, 2013 8:26 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Also you need to lookup the documentation. Encoding (in this case) has no relation to a character code set. It describes the endian-ness of the numeric data and other numeric data characteristics.... So your value of 1208 for encoding is most certainly wrong. You might want to check if it is appropriate to go with InputRoot.Properties for the CCSID and Encoding values... or else follow mqjeff's advice and ditch encoding entirely (presuming you have no numeric data with binary representation in your bitstream)
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Casting Error after message comes from SAPInput Node
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.