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 mixed charsets within blob

Post new topic  Reply to topic
 convert mixed charsets within blob « View previous topic :: View next topic » 
Author Message
Thomas
PostPosted: Fri Feb 28, 2003 1:51 pm    Post subject: convert mixed charsets within blob Reply with quote

Novice

Joined: 25 Sep 2002
Posts: 10
Location: Germany

hi all,
i'll get from mvs-mqhost a mixed-charset-ebcdic-blob message.
let me explain (for example):
from 1-100 the host charsetset is 273 (western europe)
from 101-200 the host charset is 875 (greece)

how can i convert this via compute-node to a valid utf-8 (ccsid=1208) xml-file ?

i think that mustbe something like that:
SET var1=CONVERT(SUBSTRING(xxx from 1 for 100) ccsid-from to ccsid-to)

can you help me ?

best regards from germany,
thomas
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Feb 28, 2003 2:36 pm    Post subject: Reply with quote

Jedi Knight

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

How are you planning to parse your input message, are you planning to use MRM-CWF or BLOB or something else?
Are you planning to send text in 1-100 and 101-200 position into 2 different xml tags?
_________________
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
Thomas
PostPosted: Sat Mar 01, 2003 9:27 am    Post subject: Reply with quote

Novice

Joined: 25 Sep 2002
Posts: 10
Location: Germany

First of all I reset the BLOB to MRM. Within computenote i'll generate the utf8-XML-output.
Please note: The example above is only the principle problem. For each textelement in MRM-structure
i'll get a languagecode (DEU, GRC, ..) witch let me decide the matching 'from-charset'.
Back to top
View user's profile Send private message
kirani
PostPosted: Sun Mar 02, 2003 8:38 pm    Post subject: Reply with quote

Jedi Knight

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

In that case you can use something like this

Code:

IF ( InputRoot.MRM.yyy = some-lang-code) then
SET OutputRoot.XML.Data.String1 = CAST ( SUBSTRING (xxx FROM 1 FOR 100) AS CHAR CCSID ccsid-to);
END IF;

_________________
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
Thomas
PostPosted: Mon Mar 03, 2003 1:10 am    Post subject: Reply with quote

Novice

Joined: 25 Sep 2002
Posts: 10
Location: Germany

unfortunately I don't understand this ;-?

the ccsid-to is always 1208, but the 'ccsid-from' depends on lang-code as described above.
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Mar 03, 2003 10:00 pm    Post subject: Reply with quote

Jedi Knight

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

I Hope this will be more clear,

1. Read your input message as BLOB in MQInput node.
2. In a compute node, first get language code using SUBSTRING function. Also, get the string data associated with this lang code and then apply CAST function to convert it into corresponding CCSID.

For example,

Code:

DECLARE LANG_CODE CHAR;
-- Get Language code
SET LANG_CODE = CAST(SUBSTRING(InputRoot.BLOB.BLOB FROM x FOR 3) AS CHAR CCSID InputRoot.Properties.CodedCharSetId);

IF ( LANG_CODE = 'GRC') THEN
  SET OutputRoot.XML.Data.Text1 = CAST(InputRoot.BLOB.BLOB FROM YY FOR XXX) AS CHAR CCSID YYYY);
  -- Here, YYYY is CCSID for GRC language.
END IF;
-- Similarly, transform other language data.

-- Finally Transform the output message to 1208 CCSID.
SET OutputRoot.Properties.CodedCharSetId = 1208;

_________________
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
Thomas
PostPosted: Tue Mar 04, 2003 11:49 am    Post subject: Reply with quote

Novice

Joined: 25 Sep 2002
Posts: 10
Location: Germany

It WORKS ! Thank you very much !

But I still don't know how it works
I thought that the ccsid within cast is always the ccsid-TO. But in your solution the ccsid is the ccsid-FROM. How does WMQI know the
FROM<=>TO conversion ?
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Mar 04, 2003 9:31 pm    Post subject: Reply with quote

Jedi Knight

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

That's correct! CCSID in CAST is always the CCSID-TO.
In above code, I am first converting the BLOB string to appropriate language CCSID and then converting the complete message to CCSID 1208. We had to do conversion in 2-stage because your input message contains data of mixed CCSID.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » convert mixed charsets within blob
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.