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 SupportDFDL model to handle bcd fields

Post new topicReply to topic
DFDL model to handle bcd fields View previous topic :: View next topic
Author Message
mindspace
PostPosted: Fri Jul 13, 2018 6:25 am Post subject: DFDL model to handle bcd fields Reply with quote

Apprentice

Joined: 22 Jan 2013
Posts: 26

Hello DFDL gurus,

I am trying to create a DFDL model for my project, the incoming message(ebcdic) is having a bcd field and the value is 104999999091232631(include length prefix -10 (in hex form)) and the actual account number - 4999999091232631(which is 16 digits)

Field Attributes:
variable length
1 byte, binary +
19 N, 4-bit BCD (unsigned packed); maximum 11 bytes

I have defined the
length prefix as length: 1 byte, type: UnsignedInt, representation: binary, binary content-number representation: lax, binary,byteorder: bigendian
And
account number as type: integer, length units: bytes, length: length prefix, representation:binary,binary content-number representation: lax, bcd

But this is returning me a value with 32 digits not 16 digits...I see prefix length type is returning correct value 16, but treating it as 16 bytes at the field level and as the field is defined as bcd (bcd means represented as a binary coded decimal with two digits per byte.)

Can some one please advise me what is the right way to model this field using DFDL?
Back to top
View user's profile Send private message
timber
PostPosted: Mon Jul 16, 2018 5:11 am Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 817

Well...you have told DFDL that lengthUnits is 'bytes' and length is 16, so it has (quite reasonably) extracted 16 bytes. Sounds as if the sending application wants to define the length in 'nibbles' (half bytes). That's a reasonable decision, but DFDL does not support lengthUnits='nibble'.

The solution is to define the length as a completely separate element. Then set the length of your BCD field using an XPath expression that calculates the BCD length from as (the value of the length field)/2.
Back to top
View user's profile Send private message
mindspace
PostPosted: Mon Jul 16, 2018 7:05 am Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2013
Posts: 26

Thank you!
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 SupportDFDL model to handle bcd fields
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.