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 » Packed Decimal Issue

Post new topic  Reply to topic
 Packed Decimal Issue « View previous topic :: View next topic » 
Author Message
sweraj
PostPosted: Wed Jan 11, 2012 7:56 pm    Post subject: Packed Decimal Issue Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Wed Jan 11, 2012 11:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Thu Jan 12, 2012 1:49 am    Post subject: Reply with quote

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
View user's profile Send private message
mapa
PostPosted: Thu Jan 12, 2012 2:03 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

Not always possible to get a COBOL CopyBook, but you can of course learn how to write one yourself.

I actually create C-header files that I import and then I change the numeric values by hand, not optimal but works fine.

As a hint related to Kimberts tip on COBOL you can see how different values gets represented in the messageset:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ad06900_.htm
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Thu Jan 12, 2012 5:42 am    Post subject: Re: Packed Decimal Issue Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jan 12, 2012 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Jan 12, 2012 1:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
sweraj
PostPosted: Wed Jun 20, 2012 10:32 pm    Post subject: Reply with quote

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
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 » Packed Decimal Issue
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.