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 » Convert EBCDIC blob to ASCII blob(MQGET)

Post new topic  Reply to topic
 Convert EBCDIC blob to ASCII blob(MQGET) « View previous topic :: View next topic » 
Author Message
justforonce
PostPosted: Mon Apr 18, 2011 10:20 am    Post subject: Convert EBCDIC blob to ASCII blob(MQGET) Reply with quote

Newbie

Joined: 18 Apr 2011
Posts: 4

Hi, This is my first post on MQSeries.

In my message flow, I am using a MQGET to get an IMS message from SYSTEM A which is in EBCDIC format and i am not planning to use an MRM but just convert it to ASCII using ESQL and put it in a XML message and send it to SYSTEM B.

I have looked up older posts that talk about EBCDIC to ASCII conversion.
But most of them talk about using MQINPUT conversion in them.

I have used the below statement to convert the EBCDIC BLOB to ASCII BLOB. Please advice if i have to use the PARSE statement or the below statement would take of the conversion if i correct the CCSID.

CAST(InputRoot.BLOB.BLOB AS CHARACTER CCSID 37)

I have used CCSIDs 437, 37. But no luck. Please help.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 18, 2011 10:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

When you use CAST to go from BLOB to CHARACTER, the CCSID specifies the CCSID the BLOB data is already in.

When you use CAST to go from CHARACTER to BLOB the CCSID specifies the CCSID the BLOB should become.

ESQL Character values are never in EBCDIC or in ASCII.
Back to top
View user's profile Send private message
justforonce
PostPosted: Mon Apr 18, 2011 10:43 am    Post subject: Reply with quote

Newbie

Joined: 18 Apr 2011
Posts: 4

I have changed my esql to use the CCSID 500 which represents the EBCDIC format and now i see partial conversion happening as i see some ascii text in the trace file before i do a MQPUT.

However, MQPUT fails with the below error.

(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 5010
(0x03000000):Text = 'XML Writing Errors have occurred'
(0x01000000):RecoverableException = (
(0x03000000):File = '/build/S600_P/src/CommonServices/ImbConverter.cpp'
(0x03000000):Line = 312
(0x03000000):Function = 'ImbConverterCPP::internalFromUnicode'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2136
(0x03000000):Text = 'Unconvertable character'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '8d00'
)
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 18, 2011 10:48 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

justforonce wrote:
I have changed my esql to use the CCSID 500 which represents the EBCDIC format and now i see partial conversion happening as i see some ascii text in the trace file before i do a MQPUT.


So you're using the advice of my most worthy associate to covert the BLOB in code page 500 into an ESQL CHARACTER variable, which as he correctly points out is neither ASCII nor EBCDIC.

You're then trying to MQPUT this CHARACTER out into a message on (presumably) an ASCII platform. What code page are you instructing WMB to use for this put, and what leads you to believe that all of the individual characters in the CHARACTER variable can be represented in this code page (as one of them at least apparently can't!)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
justforonce
PostPosted: Mon Apr 18, 2011 10:54 am    Post subject: Reply with quote

Newbie

Joined: 18 Apr 2011
Posts: 4

Just to clarify, I am inserting the esql CHARACTER variable(that is casted from the EBCDIC blob) into a CData section of an XML and doing an MQPUT after that. Find the Output Message parameters as below.

(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2011-04-18 18:37:12.620'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'XXXXXXXX'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d51204c58524f4d41443220202020640e5c4d04d6a120'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'LXROMAD2 '
(0x03000000):UserIdentifier = 'mqm '
(0x03000000):AccountingToken = X'160105150000002fd5ec6d54190e2907e53b2b4dc9000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = '\RFHUtil-Ver7.0\rfhutilc.exe'
(0x03000000):PutDate = DATE '2011-04-18'
(0x03000000):PutTime = GMTTIME '18:37:12.620'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 18, 2011 10:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You realize that broker v6.0 goes out of support in a week or two, right?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 18, 2011 11:06 am    Post subject: Reply with quote

Grand High Poobah

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

justforonce wrote:
I have changed my esql to use the CCSID 500 which represents the EBCDIC format and now i see partial conversion happening as i see some ascii text in the trace file before i do a MQPUT.

However, MQPUT fails with the below error.

(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 5010
(0x03000000):Text = 'XML Writing Errors have occurred'
(0x01000000):RecoverableException = (
(0x03000000):File = '/build/S600_P/src/CommonServices/ImbConverter.cpp'
(0x03000000):Line = 312
(0x03000000):Function = 'ImbConverterCPP::internalFromUnicode'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2136
(0x03000000):Text = 'Unconvertable character'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '8d00'
)


Are you sure of the CCSID of the input message?
Are you sure that the message contains only characters?
Can you request a copy book for the content of the message?

Also when converting from BLOB to CHAR use InputRoot.Parameters.CodedCharSetId....

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Apr 18, 2011 11:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

justforonce wrote:
Just to clarify, I am inserting the esql CHARACTER variable(that is casted from the EBCDIC blob) into a CData section of an XML and doing an MQPUT after that. Find the Output Message parameters as below.


And you're sure that the contents of the message can be represented in code page 437? Just because it's in a CData section doesn't exempt it from the code page rules.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
justforonce
PostPosted: Mon Apr 18, 2011 11:38 am    Post subject: Reply with quote

Newbie

Joined: 18 Apr 2011
Posts: 4

I am pasting the Properties and MQMD data that i see on the IMS message(picked up using MQGET). This is a new implementation and i am not sure if the data can be converted successfully, i hope it does.

(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 785
(0x03000000):CodedCharSetId = 0
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2011-04-18 19:23:54.790'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'414d51204c58524f4d41443220202020640e5c4d05f8a120'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'XXXXXXXXXXXXX'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 785
(0x03000000):CodedCharSetId = 500
(0x03000000):Format = 'MQIMS '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 2
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'c3e2d840d4d8d4e34040404040404040c7a469dd4d83174b'
(0x03000000):CorrelId = X'414d51204c58524f4d41443220202020640e5c4d05f8a120'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'MQMT '
(0x03000000):UserIdentifier = 'XXXXXXXX'
(0x03000000):AccountingToken = X'160105150000002fd5ec6d54190e2907e53b2b4dc9000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 20
(0x03000000):PutApplName = 'XXXXXXXXXXX'
(0x03000000):PutDate = DATE '2011-04-18'
(0x03000000):PutTime = GMTTIME '19:23:54.790'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000000):MQIIH = (
(0x03000000):Version = 1
(0x03000000):Format = 'MQIMSVS '
(0x03000000):Encoding = 785
(0x03000000):CodedCharSetId = 0
(0x03000000):Flags = 0
(0x03000000):LTermOverride = 'IF01 '
(0x03000000):MFSMapName = ' '
(0x03000000):ReplyToFormat = ' '
(0x03000000):Authenticator = ' '
(0x03000000):TranInstanceId = X'c7a469dd44824ecb4040404040404040'
(0x03000000):TranState = ' '
(0x03000000):CommitMode = '1'
(0x03000000):SecurityScope = ' '
(0x03000000):Reserved = ' '
)
(0x01000000):BLOB = (
(0x03000000):UnknownParserName = 'MQIMSVS'
(0x03000000):BLOB = X'01440309404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040d9c5d1c5c3e3c5c440d9f9f1f440d9f0f2f240d9f9f1f240d9f2f0f640d9f9f8f140d9f0f8f240d9f9f8f640d9f9f9f340d9f9f4f1404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040000503014a'
)
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 18, 2011 11:41 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

justforonce wrote:
i am not sure if the data can be converted successfully


If it could, WMB wouldn't be throwing "unconvertable character" errors at you!

You might need a different target code page (I've not gone through your data byte by byte to identify the failing character) or better still have the target app use Unicode.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Mon Apr 18, 2011 4:32 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

It is difficult to read or respond to posts with excessively long lines. Use the 'Edit' button in the upper right corner to wrap or truncate them.

[code] tags also make it easier to read formatted text.

justforonce wrote:
I am pasting the Properties and MQMD data that i see on the IMS message(picked up using MQGET).
...
Code:

  (0x01000000):MQIIH      = (
    (0x03000000):Version        = 1
    (0x03000000):Format         = 'MQIMSVS '
    ...
  )
  (0x01000000):BLOB       = (
    (0x03000000):UnknownParserName = 'MQIMSVS'
    ...

CAST(BLOB AS CHAR) only works when the BLOB represents a string (Format=MQFMT_STRING). It doesn't work for more complex structures, (such as MQFMT_IMS_VAR_STRING).

Setting OutputRoot.Properties.CodedCharSetID is usually sufficient for the MRM parser to automatically convert character data in the outgoing message.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert EBCDIC blob to ASCII blob(MQGET)
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.