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 IndexWebSphere Message Broker SupportASBITSTREAM Function omitting NULL Valued fields

Post new topicReply to topic
ASBITSTREAM Function omitting NULL Valued fields View previous topic :: View next topic
Author Message
SachIsLife
PostPosted: Sat Mar 17, 2018 4:58 am Post subject: ASBITSTREAM Function omitting NULL Valued fields Reply with quote

Newbie

Joined: 17 Mar 2018
Posts: 2

Hello All,

I am trying to create a DFDL tree in Environment.Variables and then trying to convert that in to character by using the ASBITSTREAM as shown below.

DECLARE Msg CHARACTER ;
SET Msg = CAST(ASBITSTREAM(Environment.Variables.DFDL) AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId);

Here CCSID used is 1208.

But, the problem is, I am not getting the entire list of DFDL fields in the Msg. When I analyzed for the same, I realized some of the input fields(non mandatory fields) are not available in the incoming message tree. As the assigned input fields are not there, the DFDL fields didnt create. In order to create the DFDL fields in Environment, I used the below code


DECLARE envRef REFERENCE TO Environment.Variables.DFDL.MsgRoot.Codeset ;
IF(EXISTS(InputRoot.XMLNSC.TEST.CodeNum[])) THEN
SET envRef.CodeNum = InputRoot.XMLNSC.TEST.noteCode;
ELSE
SET envRef.CodeNum VALUE = NULL;
END IF;

and I am able to populate the DFDL fields after this with null values, but when I finally convert the Environment.Variables.DFDL to BLOB using ASBITSTREAM, All the mandatory and non mandatory fields with values are existing in Msg. The only missing part is, elements with null values.

Am I missing something here? or any changes required in the code ? Please suggest. I have gone through most of the available information but, not able to identify the root cause.

Toolkit Version : 10.0.0.8
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Mar 17, 2018 10:57 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19743
Location: LI,NY

Remember the environment tree has no parser unless you set one explicitely.
So if you did not set a parser on your Environment Tree, the results of ASBITSTREAM are very likely to be unreliable.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
SachIsLife
PostPosted: Sat Mar 17, 2018 3:47 pm Post subject: Reply with quote

Newbie

Joined: 17 Mar 2018
Posts: 2

Thanks for the reply fjb_saper. I have set the DFDL Domain explicitly to create the DFDL tree in Environment tree. Somehow the null value fields are missing in the converted character form of my DFDL tree.

CREATE LASTCHILD OF Environment.Variables AS ev DOMAIN 'DFDL' ;
Back to top
View user's profile Send private message
timber
PostPosted: Sun Mar 18, 2018 9:27 am Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 837

DFDL treats NULL values in a special way. The value NULL is not part of the normal 'value space' of the element's' type, so you have to explicitly tell DFDL what a 'nil' value looks like in *your* data format. Take a look at the DFDL properties on a simple element (xs:string) and you will see what I mean.

Alternatively, set the values to the empty string in the message tree, instead of setting them to NULL. That *might* produce the behaviour that you want - but do not take my word for it!

You may find it useful to take a debug-level user trace on the integration server where your message flow is deployed. That will contain a full list of everything that the DFDL parser did, and why.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportASBITSTREAM Function omitting NULL Valued fields
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.