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 » null assigned to unnullible field ?

Post new topic  Reply to topic
 null assigned to unnullible field ? « View previous topic :: View next topic » 
Author Message
pcelari
PostPosted: Wed Aug 11, 2010 10:30 am    Post subject: null assigned to unnullible field ? Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

Hi,

in a message definition from a cobol copy book, all fields are fixed string or packed decimal with fixed length.

For all fields, I manually set endoding Null to "NullPadFill" and Padding character to SPACE for string elements.

In a compute node, I set each field with the result from a stored procedure call to get resultset from a database. Some of the fields contains nothing.

But the flow throws a parser exception upon putting the message to a queue in the MQOutput node: "Cannot assign MRM-defined null value. Nulls not allowed for this element." this happened to a field of string type.

What have I missed?

thanks for any insight!


_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Aug 11, 2010 11:23 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

That sounds like a part of the error message. These messages usually contain advice about how to fix the problem. Can you please quote the full text of the error message, including the BIPnnnnE number. You should find it all in the Windows Event Viewer. If on a non-windows platform, a user trace will show you the entire message. Or you can type the BIP number into Google and find the message text that way.
Back to top
View user's profile Send private message
brokerDev
PostPosted: Wed Aug 11, 2010 12:19 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Jun 2006
Posts: 53

Could it be that when you are setting fields using data returned from the DB you are inadvertently setting the field to null? I'm asking this as you mentioned that some of the fields contain nothing. Perhaps you could COALESCE the value from the result set with
Quote:
''
when you set the field value if you're not already doing so.
Back to top
View user's profile Send private message
pcelari
PostPosted: Thu Aug 12, 2010 5:29 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

kimbert wrote:
That sounds like a part of the error message. These messages usually contain advice about how to fix the problem. ....


Thank you kimbert for pointing that out. it's BIP5461 and 5350.

Based on the tips in the explanation. I think I need to set the "default" under logical properties - Value - default to spaces of the fixed length.

This seems to be an unnecessary necessity. As physical property is already defined as fixed length string, with length specified, padding character as 'Space', and Encoding Null set to 'NullPadFill'.



_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
pcelari
PostPosted: Thu Aug 12, 2010 7:10 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

brokerDev wrote:
... Perhaps you could COALESCE the value from the result set with
Quote:
''
when you set the field value if you're not already doing so.


thanks brokerDev for the insight. I've never used coalesce() function yet. It is certainly a good guard against null value getting asigned. I've learned a new function. thank you!

the flow works now after I manually typed in the number of spaces in the default value field under logical property.
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Aug 12, 2010 10:34 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Glad it was useful. Not sure whether you noticed the part in bold. You seem to have concentrated on the other parts. Setting the Nillable property seems a little easier than the other options that have been discussed...
Quote:
Check the message set null representation properties for this element. For example, ensure that the 'nillable' logical property is correctly set.
If using a Null Encoding of 'NullLiteralFill' ensure that the physical type is not 'Null Terminated' or 'Length Encoded String'.
If using ESQL, check your code for statements like 'VALUE = NULL' See previous messages for details of the message set and message.
Back to top
View user's profile Send private message
Amazer
PostPosted: Mon Oct 31, 2011 4:08 am    Post subject: BIP5461 and 5350 Reply with quote

Novice

Joined: 10 Feb 2009
Posts: 24

Hi,

I migrated a number of messages from ver 2.1 to ver 6.1 and got the same error.

After going through the discussions above (which were useful), I managed to solve the issue by putting COALESCE for the fields that were containing nulls.

My query is this - if I have about 200 fields/elements in the COBOL copybook is there a simple way to select the 'nillable' option for each element without having to go to each element manually and do the selection?

-Amazer

Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Oct 31, 2011 1:38 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
is there a simple way to select the 'nillable' option for each element without having to go to each element manually and do the selection?
The .mxsd file is simply XML Schema with annotations. So answer is yes, but only if you know XML Schema and you are confident with a text editor, and you take a backup of your message set first, and you don't expect help from IBM if you mess it all up.

I think you know this already, but in case somebody else finds this post...

Setting nillable to true is an *alternative* to using COALESCE. When you use COALESCE, you are changing the NULL value to a non-NULL value. When you set nillable=true you are allowing the MRM parser to output the defined ( modelled ) null representation for the field. This s better than the COALESCE solution because there's less code to maintain.
Back to top
View user's profile Send private message
Amazer
PostPosted: Mon Oct 31, 2011 10:02 pm    Post subject: Reply with quote

Novice

Joined: 10 Feb 2009
Posts: 24

Thanks, Kimbert that was useful.

-Amazer
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 » null assigned to unnullible field ?
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.