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 » [SOLVED] Using ASBITSTREAM with DFDL parsers

Post new topic  Reply to topic
 [SOLVED] Using ASBITSTREAM with DFDL parsers « View previous topic :: View next topic » 
Author Message
mbmqusr
PostPosted: Tue Jul 02, 2013 2:29 pm    Post subject: [SOLVED] Using ASBITSTREAM with DFDL parsers Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

Dear All
I am facing a problem. If you can please advise. This is the code below.
I am using WMB V8.0.02


Code:
DECLARE vchar CHARACTER;
                
SET vchar = CAST(ASBITSTREAM(InputRoot.DFDL.ROOTRECORD.SUBTREE ENCODING InputRoot.MQMD.Encoding  CCSID InputRoot.MQMD.CodedCharSetId OPTIONS RootBitStream ) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId );




I am getting the Entire DFDL Tree as character, even though I am referring to a Subtree for the FieldReference parameter of the ASBITSTREAM function.

I explored the OPTIONS, and stumbled upon choices like RootBitStream, FolderBitStream and like things. Looks like FolderBitStream is not supported for DFDL. And the way RootBitstream works, it will always give me the entire message as a bitstream, not just the Subtree.

Is my understanding correct?

If my understanding is correct, how do i achieve it alternatively?

Can please advise

Thank You
mbmqusr


Last edited by mbmqusr on Wed Jul 03, 2013 10:05 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 02, 2013 2:39 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You are correct that the DFDL domain does not support the FolderBitstream option.

There is an easy way to work around it. Create a DFDL tree in the local environment. Copy the subtree there, and then use ASBITSTREAM to convert it to a bitstream.
Back to top
View user's profile Send private message
mbmqusr
PostPosted: Tue Jul 02, 2013 2:51 pm    Post subject: Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

Thank You Kimbert

I didn't understand about local environment.

But, i tried doing this with no sucess.

Code:
   DECLARE vchar CHARACTER;      
             
       
        SET Environment.DFDL.SUBTREE = InputRoot.DFDL.ROOTRECORD.SUBTREE;
        SET vchar = CAST(ASBITSTREAM(Environment.DFDL.SUBTREE ENCODING InputRoot.MQMD.Encoding  CCSID InputRoot.MQMD.CodedCharSetId OPTIONS RootBitStream ) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId );


Can you please advise?
Back to top
View user's profile Send private message
mbmqusr
PostPosted: Tue Jul 02, 2013 2:57 pm    Post subject: Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

Got it. You may have meant meant a DFDL structure in the localenvironment using CREATE... PARSE

Let me try that
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 02, 2013 3:07 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Yes, that is exactly what I meant.
Back to top
View user's profile Send private message
mbmqusr
PostPosted: Tue Jul 02, 2013 3:17 pm    Post subject: Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

Thank You again Kimbert

Did you mean Environment or LocalEnvironment?
Back to top
View user's profile Send private message
mbmqusr
PostPosted: Tue Jul 02, 2013 3:52 pm    Post subject: Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

I am trying to create the DFDL domain in local environment or in environment. Both fails

Code:

CREATE LASTCHILD OF Environment.Variables
      DOMAIN('DFDL')
      PARSE (ASBITSTREAM(InputRoot.DFDL.ROOTRECORD.SUBTREE ENCODING InputRoot.MQMD.Encoding  CCSID InputRoot.MQMD.CodedCharSetId));


It gives a BIP5822 error saying

Quote:
Cannot continue - messageTypeName is empty


Any ideas?
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 03, 2013 12:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Did you mean Environment or LocalEnvironment?
I meant what I said . You are smart enough to work out which one you need.

Quote:
I am trying to create the DFDL domain in local environment or in environment. Both fails
Yes. That is because you have failed to press 'start' on your brain.
Your code is
1. Converting InputRoot.DFDL.ROOTRECORD.SUBRECORD to a sequence of bytes
2. Attempting to parse that sequence of bytes back into a message tree ( but you did not provide the name of a global element, so that fails )
3. Placing the resulting message tree as the last child of Environment.Variables.

I suggest that you change your code to
1. Create an element in the (Local)Environment, owned by the DFDL domain
2. Copy your subtree under that node.
This forum is full of examples that show how to do this ( most using the XMLNSC domain ). Please use the search button.
Back to top
View user's profile Send private message
mbmqusr
PostPosted: Wed Jul 03, 2013 9:05 am    Post subject: Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

Sorry, I think I am not getting it

I tried following what you said Kimbert. Looks like I was not able to, thats why I still have a problem.

Code:
CREATE LASTCHILD OF Environment.Variables
        DOMAIN 'DFDL';

       
        SET Environment.Variables.DFDL.SUBTREE = InputRoot.DFDL.ROOTRECORD.SUBTREE;
       
        DECLARE vchar BLOB;
        SET vchar = ASBITSTREAM(Environment.Variables.DFDL.SUBTREE ENCODING InputRoot.MQMD.Encoding   CCSID InputRoot.MQMD.CodedCharSetId);


It is not recognizing the Root element, and giving me an error

Root element 'SUBTREE' in namespace '' does not exist.

Do i have to define the SUBTREE as a Global element in the same or another DFDL?

I am really not able to start my brain, it looks like
Back to top
View user's profile Send private message
mbmqusr
PostPosted: Wed Jul 03, 2013 10:04 am    Post subject: Reply with quote

Newbie

Joined: 02 Jul 2013
Posts: 9

Solved, Finally. This is what I did

I created another DFDL Global Element called SUBTREE

And then this works

Code:
   DECLARE parseOptions INTEGER BITOR(ValidateContentAndValue, ValidateException, ValidateComplete);
        DECLARE vAcctNum CHARACTER;
       
        CREATE LASTCHILD OF Environment.Variables
        DOMAIN 'DFDL';
               
        SET Environment.Variables.DFDL.SUBTREE = InputRoot.DFDL.ROOTRECORD.SUBTREE;
        SET vAcctNum = CAST(ASBITSTREAM(Environment.Variables.DFDL.SUBTREE OPTIONS parseOptions ENCODING InputRoot.MQMD.Encoding  CCSID InputRoot.MQMD.CodedCharSetId TYPE '{}:SUBTREE') AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);


Am i doing anything redundant? Or this is fine?

Thank You Kimbert
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 03, 2013 11:45 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Glad you got it working.

I don't think you are doing anything redundant. You needed the CREATE...DOMAIN 'DFDL', as you now realize.
Quote:
This is what I did
I created another DFDL Global Element called SUBTREE
I don't see where you are doing that. The code looks the same in both of your last two posts. But it doesn't matter - the main thing is that the code is correct.
Quote:
I am really not able to start my brain, it looks like
I disagree - it seems to be operating normally now
Back to top
View user's profile Send private message
FireDragon$layer
PostPosted: Fri Feb 17, 2017 8:17 am    Post subject: Reply with quote

Newbie

Joined: 17 Feb 2017
Posts: 1

Hi pardon me if I'm wrong in reopening this thread.

I am able to parse a DFDL message successfully by using this code -
Code:
SET invMsgBlob = ASBITSTREAM(InputBody
      OPTIONS RootBitStream
      ENCODING InputRoot.MQMD.Encoding
      CCSID InputRoot.MQMD.CodedCharSetId
      TYPE refToInvoiceVars.MessageType);

but the BLOB doesn't seem to have any data in it.
Any suggestions here??
What is the correct CCSID and ENCODING i should be using to convert DFDL to BLOB ?
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 » [SOLVED] Using ASBITSTREAM with DFDL parsers
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.