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 datatypes in DFDL

Post new topic  Reply to topic
 Handling datatypes in DFDL « View previous topic :: View next topic » 
Author Message
rajbuddha
PostPosted: Tue Aug 14, 2012 6:20 am    Post subject: Handling datatypes in DFDL Reply with quote

Apprentice

Joined: 02 Aug 2011
Posts: 47
Location: chennai

Hi,

For the message model using DFDL,when the datatype of the local element is integer and the fieldlength is made explicit, for example

Let stud_no be the local element with integer datatype and the fieldlength is given as 10. When I give the input as 0000056789, after the test-serialize view I get as 56789. But I require the output as 0000056789 even after serialization.
I have set the properties of padding characters to 0 but in vain.

What should be done to acheive the above??

Thanks in advance..
_________________
-----------

Raju Buddha

Never Wait for your 2nd Opportunity..!Becoz it may be harder than the 1st One...
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Tue Aug 14, 2012 6:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Your trying to treat an integer datatype like a string datatype. You cannot have it both ways. Either it is a string (with leading zeros) or it is an integer (empirical value with no leading zeros). Which one do you want? You cannot have both.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Aug 14, 2012 6:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
Your trying to treat an integer datatype like a string datatype. You cannot have it both ways. Either it is a string (with leading zeros) or it is an integer (empirical value with no leading zeros). Which one do you want? You cannot have both.


lancelotlinc - There are a lot of good solid reasons why a field might need to always be a fixed length.

Rajbuddha - So you've set the Length Kind to 'explicit' and set Length and set length units to characters?

You have to set the Text Number Representation to include a Number Pattern that will force the output of 0's. You likely have it set to '#0' right now, and need to set it to somehting like '0000000000' (one 0 for each digit).
Back to top
View user's profile Send private message
rajbuddha
PostPosted: Thu Aug 16, 2012 3:43 am    Post subject: Reply with quote

Apprentice

Joined: 02 Aug 2011
Posts: 47
Location: chennai

lancelotlinc - I am trying for an integer datatype with leading zeros..

mqjeff - Ya, I have set the Length Kind to 'explicit' and set Length and set length units to characters. How to set the Text Number Representation?? I find two options- standard and zoned, which should I opt to include a Number Pattern??

Thanks..
_________________
-----------

Raju Buddha

Never Wait for your 2nd Opportunity..!Becoz it may be harder than the 1st One...
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Aug 16, 2012 5:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It shows up for both types, underneath the 'Text Number Representation' (which is part of Text Content).

I.e. you have to click the little plus button to expand the field to show the sub-properties.
Back to top
View user's profile Send private message
rajbuddha
PostPosted: Thu Aug 16, 2012 6:34 am    Post subject: Reply with quote

Apprentice

Joined: 02 Aug 2011
Posts: 47
Location: chennai

ya i could find that.. the number pattern is already set to '#0'.

should I give any specified values under text format within the sub properties ie., should i apply any pattern if so what should be given??

Thanks..
_________________
-----------

Raju Buddha

Never Wait for your 2nd Opportunity..!Becoz it may be harder than the 1st One...
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Aug 16, 2012 6:45 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

rajbuddha wrote:
ya i could find that.. the number pattern is already set to '#0'.


Yes. That's the source of the problem. The # does not force the output of a digit. The 0 does. You need to put in as many 0's as you need to force digits to appear.

As I said "need to set it to something like '0000000000' (one 0 for each digit)."
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Aug 21, 2012 11:51 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

At minimum, you need to set three DFDL properties:
- textPadKind should be set to 'padChar'
- textStringPadCharacter should be set to '0'
- textStringJustification should be set to 'right'
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 21, 2012 12:01 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
At minimum, you need to set three DFDL properties:
- textPadKind should be set to 'padChar'
- textStringPadCharacter should be set to '0'
- textStringJustification should be set to 'right'


Oh, sure, the easy way...
Back to top
View user's profile Send private message
rajbuddha
PostPosted: Mon Aug 27, 2012 1:27 am    Post subject: Reply with quote

Apprentice

Joined: 02 Aug 2011
Posts: 47
Location: chennai

@mqjeff : Thanks a lot

@kimbert : Thanks..
_________________
-----------

Raju Buddha

Never Wait for your 2nd Opportunity..!Becoz it may be harder than the 1st One...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Handling datatypes 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.