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 » Packed Decimal Conversion from DFDL

Post new topic  Reply to topic
 Packed Decimal Conversion from DFDL « View previous topic :: View next topic » 
Author Message
mqued
PostPosted: Wed Feb 27, 2013 2:35 am    Post subject: Packed Decimal Conversion from DFDL Reply with quote

Novice

Joined: 27 Feb 2013
Posts: 14



Hello All,

I am trying to send some fields in packed decimal format from WMB v8001 and have set the below properties in DFDL. The message is sent from windows to AS 400.


    Representation : Binary
    Length :3
    Length units: bytes

    Packed sign codes: A B F 0
    Binary Number representation : packed
    Decimal Virtual point :1
    Binary Number check policy : lax


In esql the field value is set to a decimal value (5.0) . But the value doesnt seem to get converted to packed format. The trace before sending the message also shows the same value.

Can somebody guide on how to achieve this?
Thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Feb 27, 2013 5:26 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Your DFDL properties look reasonable enough.
Quote:
But the value doesnt seem to get converted to packed format.
Well, I can offer sympathy at this point, but not much else. What exactly *does* the output look like?
Quote:
The trace before sending the message also shows the same value.
Do you mean that the DFDL parser is correctly receiving the logical value 5.0?
Back to top
View user's profile Send private message
mqued
PostPosted: Sat Mar 02, 2013 8:25 pm    Post subject: Reply with quote

Novice

Joined: 27 Feb 2013
Posts: 14

Hello kimbert,

Thanks for the reply. Here is what i am trying to achieve.
From broker I have to send the message as fixed width with some fields as packed and some as character to AS 400.


In ESQL,
Code:

SET OutputRoot.MQMD.Encoding       =  546 ;  --273
SET OutputRoot.MQMD.CodedCharSetId    =  1208;


then defining a field as byte(tried decimal also) in xsd, and setting the value as below expecting the parser to do the conversion

Code:

--When trying with byte
SET outMsgDataRef.DbReserved          = CAST (1 AS BLOB CCSID 1208);
--While trying with decimal
SET outMsgDataRef.DbReserved          = 3.0;


The trace shows

Code:

--When byte
 (0x03000000:NameValue):DbReserved             = X'000000000001'
--When decimal
 (0x03000000:NameValue):DbReserved             = 3.0 (DECIMAL)


Is this the right way to pack some numeric fields and sent along with other charactor fields?
Back to top
View user's profile Send private message
kimbert
PostPosted: Sun Mar 03, 2013 1:03 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

When you look at your Trace node output you are looking the logical representation of your output message. That should be the number 3.0. Not the string '3' or '3.0'. And certainly not a BLOB.
Code:
--When trying with byte
SET outMsgDataRef.DbReserved          = CAST (1 AS BLOB CCSID 1208);
The XML Schema type 'byte' is a number. Why are you assigning a BLOB to it? ( not that it matters, xs:decimal is probably the correct data type for a decimal number. )
Quote:
is this the right way to pack some numeric fields and sent along with other charactor fields?
No. You do not have to 'pack' the numeric fields. You have already told the DFDL parser how to do that.
Code:
--While trying with decimal
SET outMsgDataRef.DbReserved          = 3.0;
That's the correct way to do it.

Code:
The trace shows:
--When byte
 (0x03000000:NameValue):DbReserved             = X'000000000001'
--When decimal
 (0x03000000:NameValue):DbReserved             = 3.0 (DECIMAL)
Why did you expect anything else? The Trace node is showing you the logical message tree. If you want to see the formatted output then you will need to examine the output queue/file/bytestream.
Back to top
View user's profile Send private message
mqued
PostPosted: Tue Mar 05, 2013 8:02 am    Post subject: Reply with quote

Novice

Joined: 27 Feb 2013
Posts: 14

You are right!! I somehow expected to see something like 1E 00 00 00 0F 03 in the trace

Its working perfectly. Thanks again for the reply.
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 » Packed Decimal Conversion from DFDL
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.