Author |
Message
|
sweraj |
Posted: Wed Jan 11, 2012 7:56 pm Post subject: Packed Decimal Issue |
|
|
Novice
Joined: 13 Jul 2010 Posts: 14
|
Hi Friends,
We are getting character values in Packed Decimal field. Our CWF message set is not able to parse it.. Generally our backEnd system sends some characters at the end of the value to represent negative values. Can any one suggest me how to handle a characters (like N or S) in packed decimal fields.
our environment : MB V. 7.0 , AS400.
If you need any more information please let me know and help me out.
Thanks & Regards |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Jan 11, 2012 11:46 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The CCSID might be correct but perhaps the encoding value is wrong? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jan 12, 2012 1:49 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Get hold of the COBOL copybook and import it. That is usually the most reliable way to get the packed decimal settings correct. If you don't want to disturb your existing ( mostly working ) solution then import the COBOL into a different, temporary project and copy the settings for the problem field. |
|
Back to top |
|
 |
mapa |
Posted: Thu Jan 12, 2012 2:03 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 12, 2012 5:42 am Post subject: Re: Packed Decimal Issue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sweraj wrote: |
Generally our backEnd system sends some characters at the end of the value to represent negative values. Can any one suggest me how to handle a characters (like N or S) in packed decimal fields. |
I endorse the comments of my associates and, for clarification (and our younger posters) these are not characters in a packed decimal field, but a signed decimal representation. Many older systems store sign in the last half byte of a packed number which makes it look, when viewed, like a letter because that byte (half number, half sign) is now the hex value of a printable character. Others actually put a character value as the leading or trailing byte to indicate sign.
Readers with time on their hands (plus either a pressing need for a hobby and/or insomnia) can research this on any COBOL document which talks about the COMP and SIGN clauses. You're better off taking my word for it.
So, in summary, find the definition of the number and from that, how it's represented. Don't try and deal with the "character" that's been added to the field because it hasn't. At least not in the sense of the field being corrupted by it, or a random character being concatenated onto it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 12, 2012 12:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And here I thought the character would be either D or F (comp-3) ?
And this is not a character value but the last byte value...
So a comp-3 would look like this 123456789F pic S9(9) and occupy 5 bytes
Not familiar with N or S... _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 12, 2012 1:05 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
fjb_saper wrote: |
And here I thought the character would be either D or F (comp-3) ? |
Well possibly; those of use of a certain age have muttered "CAFE" to ourselves as a mnemonic for positive & negitive.
fjb_saper wrote: |
And this is not a character value but the last byte value...
So a comp-3 would look like this 123456789F pic S9(9) and occupy 5 bytes |
Unless it's TRAILING SEPARATE.
fjb_saper wrote: |
Not familiar with N or S... |
Nor I, but I suspect some odd combination of endcoding and character set. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sweraj |
Posted: Wed Jun 20, 2012 10:32 pm Post subject: |
|
|
Novice
Joined: 13 Jul 2010 Posts: 14
|
saper, vitor and smdavies99 thank you for all your support, We solved it based on your valuable suggestions. I am sorry for the too late reply. |
|
Back to top |
|
 |
|