Author |
Message
|
sasad |
Posted: Mon Nov 10, 2014 4:02 am Post subject: Set spaces in decimal field of DFDL |
|
|
Acolyte
Joined: 30 Apr 2014 Posts: 67
|
Hi all,
I have fixed length message. for that I have created DFDL. There are two amount fields with format 99999.99 . I have used decimal type for these fields. But problem is that some time this fields may not have any value but due to fixed length I need to pass Spaces for in place of amount.
I tried nil value and default value properties but no success. Can anyone suggest me a solution.
Thanks, |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 10, 2014 5:25 am Post subject: Re: Set spaces in decimal field of DFDL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sasad wrote: |
There are two amount fields with format 99999.99 . I have used decimal type for these fields. But problem is that some time this fields may not have any value but due to fixed length I need to pass Spaces for in place of amount. |
Then it's not a decimal. A decimal number can't contain spaces. It's a character field that happens to be used for a string of characters formatted as a decimal number.
sasad wrote: |
Can anyone suggest me a solution. |
Use a character field. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 10, 2014 6:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Or *very very* carefully do some research here for discussion of DFDL and NULL values. |
|
Back to top |
|
 |
magvlvri |
Posted: Mon Nov 10, 2014 11:53 am Post subject: |
|
|
Apprentice
Joined: 07 Nov 2014 Posts: 26
|
101 of MsgSets in WMB/IIB.....keep reading  |
|
Back to top |
|
 |
kimbert |
Posted: Mon Nov 10, 2014 3:07 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
@magvlvri: Not exactly '101'. Null handling tends to confuse a lot of users.
And this question is about DFDL, not MRM. So message sets are not in play. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
magvlvri |
Posted: Wed Nov 12, 2014 7:29 am Post subject: |
|
|
Apprentice
Joined: 07 Nov 2014 Posts: 26
|
thanks for correcting me.....used to calling all message models loosely as message sets |
|
Back to top |
|
 |
sasad |
Posted: Mon Nov 17, 2014 1:58 am Post subject: |
|
|
Acolyte
Joined: 30 Apr 2014 Posts: 67
|
If I take this as character field then how should i validation on it. What i want to do is that
1) if this field contain spaces, treat it as null values.
2) if this field contain some values validate these against pattern provided.
how can i acheive this, can you please guide me. |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Nov 17, 2014 2:13 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
|
Back to top |
|
 |
sasad |
Posted: Tue Nov 18, 2014 12:23 am Post subject: |
|
|
Acolyte
Joined: 30 Apr 2014 Posts: 67
|
Thanks @smdavies and @kimbert. this solution worked for me. |
|
Back to top |
|
 |
|