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 IndexWebSphere Message Broker (ACE) Support[shift] IDOC parser always using codepage 819?

Post new topicReply to topic
[shift] IDOC parser always using codepage 819? View previous topic :: View next topic
Author Message
Tibor
PostPosted: Thu Feb 16, 2006 4:39 am Post subject: [shift] IDOC parser always using codepage 819? Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Environment:
- AIX v5.2
- WMQ v5.3 + CSD11
- WMB v5 + CSD06
- R/3Link v1.2
- broker qmgr codepage is 819/437
- flow:
MQInput(IDOC) ---> Trace1 ---> Compute ---> Trace2 ---> MQOutput

My problem: when I convert an IDoc to a unicode XML (now UTF-8 ), the output is message contains bad characters. Only Latin-2 specific characters goes to bad the next way: these are converted from Latin-1 (819).

Examples from trace file, IDoc -> XML conversion
- IDOC input
Code:
(0x01000000):Properties = (
    (0x03000000):MessageSet      = 'SAP01'
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 273
    (0x03000000):CodedCharSetId  = 912
    (0x03000000):Transactional   = TRUE
    (0x03000000):Persistence     = TRUE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2006-02-16 10:51:17.290'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):MQMD       = (
    (0x03000000):SourceQueue      = 'TEST_BATA_1'
    (0x03000000):Transactional    = TRUE
    (0x03000000):Encoding         = 273
    (0x03000000):CodedCharSetId   = 912
    (0x03000000):Format           = 'MQSTR   '
    (0x03000000):Version          = 2
    (0x03000000):Report           = 0
    (0x03000000):MsgType          = 8
...
    (0x01000000):DD = (
      (0x03000000):segnam   = 'Z2HRMETA000                   '
      (0x03000000):mandt2   = '010'
      (0x03000000):docnum2  = '0000000000043457'
      (0x03000000):segnum   = '000034'
      (0x03000000):psgnum   = '000000'
      (0x03000000):hlevel   = '02'
      (0x01000000):sdatatag = (
        (0x01000021):MRM = (
...
          (0x0300000B):koltseghely_kod     = '0000085030'
          (0x0300000B):koltseghely_neve    = 'MŰKÖDÉSTÁMOGATÁSI IGAZGATÓ HELYETTES    '
...

- XML output
Code:
(
  (0x01000000):Properties = (
    (0x03000000):MessageSet      = 'SAP01'
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 273
    (0x03000000):CodedCharSetId  = 1208
    (0x03000000):Transactional   = TRUE
    (0x03000000):Persistence     = TRUE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2006-02-16 10:51:17.290'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):MQMD       = (
    (0x03000000):SourceQueue      = 'TEST_BATA_1'
    (0x03000000):Transactional    = TRUE
    (0x03000000):Encoding         = 273
    (0x03000000):CodedCharSetId   = 1208
    (0x03000000):Format           = 'MQSTR   '
    (0x03000000):Version          = 2
    (0x03000000):Report           = 0
    (0x03000000):MsgType          = 8
...
  (0x01000010):XML        = (
    (0x05000018):                = (
      (0x02000000): = ''
      (0x06000011): = '1.0'
      (0x06000012): = 'UTF-8'
    )
...
        (0x01000000):koltseghely_kod     = (
          (0x02000000): = '0000085030'
        )
        (0x01000000):koltseghely_neve    = (
          (0x02000000): = 'MŰKÖDÉSTÁMOGATÁSI IGAZGATÓ HELYETTES    '
        )
...


In this example the tricky character is &#368 (UTF-8 C5 B0) will be converted to UTF-8 C3 9B on MQOutput node. It would be right when codepage is 819, but it is set to 912.

4 Hungarian characters have this problem, e.g. these are same code in different single-byte codepages, but I'm afraid other Latin-2 dependent languages will be converted in similar way (slovak, polish, etc)

Moreover, when I cut the DD segment from IDoc and send into another input through MRM parser it works fine.

Any idea?


Last edited by Tibor on Fri Feb 17, 2006 8:20 am; edited 2 times in total
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 16, 2006 6:03 am Post subject: Reply with quote

Grand High Poobah

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

Tibor,

You can look at the entire IDOC (beyond the SAPH header) as a BLOB and CAST to the CCSID you need from whatever is on the message.

You can then parse, change, cast to target ccsid and set in message properties.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Tibor
PostPosted: Thu Feb 16, 2006 7:12 am Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

fjb_saber,

Thanks the tip, I've just tried it without any success. Perhaps I misunderstand you

flow v0.2:
MQInput(BLOB) --> Compute0 --> RCD(IDOC) --> Trace1 --> (...)

ESQL in Compute0:
Code:
      CALL CopyMessageHeaders();
      
      SET OutputRoot.MQSAPH = NULL;
      SET OutputRoot.BLOB.BLOB = cast(InputRoot.BLOB.BLOB as BLOB ccsid 912);
      SET OutputRoot.Properties.CodedCharSetId = 912;
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 16, 2006 5:01 pm Post subject: Reply with quote

Grand High Poobah

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

Tibor you have to first cast the BLOB as CHAR CCSID .... then recast as BLOB. (2 CASTS in one line).

Cast from BLOB to CHAR translating from source CCSID to broker
Cast from CHAR to CHAR translating from broker to target CCSID.
Cast from CHAR to BLOB....

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Tibor
PostPosted: Fri Feb 17, 2006 8:18 am Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Hi fjb_saper,

Sorry, but it didn't work for me, that's why I re-invented the wheel ... er ... the IDoc parser.
Code:
DECLARE iLen INTEGER LENGTH(InputRoot.BLOB.BLOB);
DECLARE iPos INTEGER 525; -- length of IDOC.DC

WHILE iPos <= iLen DO
   CREATE LASTCHILD OF OutputRoot.MRM.DD
      PARSE(SUBSTRING(InputRoot.BLOB.BLOB FROM iPos+63 FOR 1000)
         CCSID 912
         SET 'SAP01'
         TYPE TRIM(CAST(SUBSTRING(InputRoot.BLOB.BLOB FROM iPos FOR 16) AS CHARACTER CCSID 912)) -- segnam
         FORMAT 'CWF');
   SET iPos = iPos+1063; -- length of IDOC.DD
END WHILE;
SET OutputRoot.Properties.MessageSet = 'SAP01';
SET OutputRoot.Properties.CodedCharSetId = 912;

Not perfect, because this code ignores the DC and DD specific variables. However there is no codepage mismatch contrary to the original parser manufactured by IBM

Tibor
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) Support[shift] IDOC parser always using codepage 819?
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.