|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
![Reply to topic](templates/DAJ_Glass/images/lang_english/reply.gif) |
|
ASBITSTREAM Function omitting NULL Valued fields |
« View previous topic :: View next topic » |
Author |
Message
|
SachIsLife |
Posted: Sat Mar 17, 2018 4:58 am Post subject: ASBITSTREAM Function omitting NULL Valued fields |
|
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
fjb_saper |
Posted: Sat Mar 17, 2018 10:57 am Post subject: |
|
|
![](images/avatars/gallery/misc/2.gif) Grand High Poobah
Joined: 18 Nov 2003 Posts: 20697 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. ![](images/smiles/innocent.gif) _________________ MQ & Broker admin |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
SachIsLife |
Posted: Sat Mar 17, 2018 3:47 pm Post subject: |
|
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
timber |
Posted: Sun Mar 18, 2018 9:27 am Post subject: |
|
|
![](images/avatars/53508560955fb354bd4bd0.jpg) Grand Master
Joined: 25 Aug 2015 Posts: 1280
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
|
|
![Reply to topic](templates/DAJ_Glass/images/lang_english/reply.gif) |
|
Page 1 of 1 |
|
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
|
|
|
|