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 » Handling BCD values for lengthPrefix in DFDL

Post new topic  Reply to topic
 Handling BCD values for lengthPrefix in DFDL « View previous topic :: View next topic » 
Author Message
Dyanoo
PostPosted: Wed Oct 26, 2022 1:11 am    Post subject: Handling BCD values for lengthPrefix in DFDL Reply with quote

Newbie

Joined: 20 Oct 2022
Posts: 4

Hi Everyone,
I came across an issue while creating DFDL for handling ISO8583 messages. My input message has few fields in LLVAR type where first 2 digits determine the length of the field, and length is provided in BCD.
Can anyone please help me in pointing to the right direction on how to handle BCD length values in DFDL..
For example,
ActNumber_Field2-104146516097772631(prefix 10 means 16 digits)
how to convert 10 to 16 in DFDL?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 26, 2022 12:42 pm    Post subject: Re: Handling BCD values for lengthPrefix in DFDL Reply with quote

Grand High Poobah

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

Dyanoo wrote:
Hi Everyone,
I came across an issue while creating DFDL for handling ISO8583 messages. My input message has few fields in LLVAR type where first 2 digits determine the length of the field, and length is provided in BCD.
Can anyone please help me in pointing to the right direction on how to handle BCD length values in DFDL..
For example,
ActNumber_Field2-104146516097772631(prefix 10 means 16 digits)
how to convert 10 to 16 in DFDL?

You have to consider that your value is given in base 16, i.e. 10 =>16
Should not be that complicated to go from there...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Thu Oct 27, 2022 6:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Are you reading the ISO8583 message, or writing it (or both)?
Back to top
View user's profile Send private message
timber
PostPosted: Thu Oct 27, 2022 2:57 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

I suspect that the answer is here: https://daffodil.apache.org/docs/dfdl/ in section 12.3.4 dfdl:lengthKind 'Prefixed'

Probably best if you read that section first, then ask any questions that you have. That way, if I need to provide guidance you will have some background for me to work with.
Back to top
View user's profile Send private message
timber
PostPosted: Fri Oct 28, 2022 1:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Actually...I have some further questions re: your data format.

1. The length is '10' which is meant to be interpreted as the number 16. That is not 'BCD' - it would be represented as the byte value 00010011 (0x16) in BCD.
2. The value is '4146516097772631'. Is this 16 bytes, or 8 bytes?
3. What character encoding are these values in? (ASCII? EBCDIC? UTF-8?)

If possible, please can you supply the bytes of the input as well as the characters. DFDL works from the raw bytes, so that will answer all questions.
Back to top
View user's profile Send private message
Dyanoo
PostPosted: Sun Oct 30, 2022 5:30 am    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2022
Posts: 4

Hi Timber,

Thanks a lot for your inputs....
Am reading the ISO8583 message.

The scenario am facing is,
ActNumber_Field2-104146516097772631
This field has prefix 10, that is 16 in hex followed by Account Number which is in bytes.

I need my prefixLength2 to read 10 as hex and convert it to decimal and to assign next 16 bytes to Account Number field.

Below is my input where 0100 is the MTI followed by primary and secondary bitmap.
0100f63c668108e0a0500000000004000000104146516097772631
Back to top
View user's profile Send private message
timber
PostPosted: Tue Nov 01, 2022 10:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

I don't have time to work out the answer for you, but this repo should contain the clues that you need: https://github.com/DFDLSchemas/ISO8583
Back to top
View user's profile Send private message
Dyanoo
PostPosted: Thu Nov 03, 2022 1:48 am    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2022
Posts: 4

Thanks Timber, I was able to resolve the issue by providing
textStandardBase="16" and type as type="hexBinary" for prefix length.
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 » Handling BCD values for lengthPrefix in 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.