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 » Replace null character in mapping node in V8.

Post new topic  Reply to topic
 Replace null character in mapping node in V8. « View previous topic :: View next topic » 
Author Message
Sachin20
PostPosted: Tue Sep 09, 2014 7:07 am    Post subject: Replace null character in mapping node in V8. Reply with quote

Newbie

Joined: 15 Nov 2009
Posts: 5

Hi,

I am using graphical data mapping node to transform cobol to xml. one of the copybook field i am getting null character. I need to replace with 0 and tried below and did not replace null characters.
custom xpath
fn:replace($AMT,'NUL','0')

fn:replace($AMT,'<NUL>','0')

fn:replace($AMT,NULL,'0').

Please share your thoughts.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Sep 09, 2014 7:12 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should adjust the incoming message model (DFDL or MRM) to do this replacement for you.
Back to top
View user's profile Send private message
Sachin20
PostPosted: Tue Sep 09, 2014 9:54 am    Post subject: Reply with quote

Newbie

Joined: 15 Nov 2009
Posts: 5

I selected check box for Recognize null values for all fields when i defined message model for cobol data. did not help.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 09, 2014 10:56 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Sachin20 wrote:
I selected check box for Recognize null values for all fields when i defined message model for cobol data. did not help.


You should probably try something else then.......

I wonder if there's more than one option you can specify.

I wonder if (as it's v if you're using DFDL or MRM?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Sep 10, 2014 6:13 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

So your input format allows null characters ( 0x00 ) but the output format ( XML ) does not. You need to translate the null characters to a valid character, or else remove them.

DFDL and MRM cannot perform character substitutions on string values - that is the task of a transformation language, not a parser.

I suggest that you do this in ESQL or Java if you cannot make the Mapping node do what you require.
_________________
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
View user's profile Send private message
Sachin20
PostPosted: Wed Sep 10, 2014 6:50 am    Post subject: Reply with quote

Newbie

Joined: 15 Nov 2009
Posts: 5

I am using DFDL parser.
Back to top
View user's profile Send private message
martinb
PostPosted: Fri Sep 12, 2014 12:08 am    Post subject: Reply with quote

Master

Joined: 09 Nov 2006
Posts: 210
Location: UK

A new topic was added to the IIB v9 Knowledge Center "Handling nulls in message maps".

You need to confirm if your model defines the field as nillable, if so you can detect the nilled value using the fn:nilled() function in the map. If it's not then it's likely the NULL value will be represented as an empty field. Assuming a character type, you could use a test for empty string in a map using,

Code:
$<variable> = ''


So to transform this in a Graphical Map you can use an If Else transform with a condition on the input value and either use a Move transform to pass the valid value to your target XML, or an Assign transform to set the required value when the input is NULL

Note Alternatively if the target XML element was modeled as nillable, then setting it from a nilled source would create an empty XML element with the xsi:nil attribute set to true.
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 » Replace null character in mapping node in V8.
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.