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 » DFDL Length of a complex type

Post new topic  Reply to topic
 DFDL Length of a complex type « View previous topic :: View next topic » 
Author Message
bobbee
PostPosted: Thu Apr 02, 2015 12:39 pm    Post subject: DFDL Length of a complex type Reply with quote

Knight

Joined: 20 Sep 2001
Posts: 545
Location: Tampa

I have a message, in it are three complex types, Two fixed and one 1:unbounded. in the 1:unbounded are string elements 1055 bytes long. I want the number of these. Fo I was trying the following

SET ALE_IDoc_LEN = LENGTH(ASBITSTREAM(InputRoot.DFDL.ns:ALE_IDoc));
SET SAPH_LEN = LENGTH(ASBITSTREAM(InputRoot.DFDL.ns:ALE_IDoc.SAPH));
SET DC_LEN = LENGTH(ASBITSTREAM(InputRoot.DFDL.ns:ALE_IDoc.DC));

Then I was going to do a little math and come up with the number of segments.

ET OutputLocalEnvironment.variables.NUM_SEGS = (ALE_IDoc_LEN - (SAPH_LEN + DC_LEN)) / 1055;

All three of the statements with ASBITSTREAM returns the length of the whole message even though I pointed to a subtree in the message.
Back to top
View user's profile Send private message Send e-mail AIM Address
fjb_saper
PostPosted: Fri Apr 03, 2015 10:08 am    Post subject: Re: DFDL Length of a complex type Reply with quote

Grand High Poobah

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

bobbee wrote:
I have a message, in it are three complex types, Two fixed and one 1:unbounded. in the 1:unbounded are string elements 1055 bytes long. I want the number of these. Fo I was trying the following

SET ALE_IDoc_LEN = LENGTH(ASBITSTREAM(InputRoot.DFDL.ns:ALE_IDoc));
SET SAPH_LEN = LENGTH(ASBITSTREAM(InputRoot.DFDL.ns:ALE_IDoc.SAPH));
SET DC_LEN = LENGTH(ASBITSTREAM(InputRoot.DFDL.ns:ALE_IDoc.DC));

Then I was going to do a little math and come up with the number of segments.

ET OutputLocalEnvironment.variables.NUM_SEGS = (ALE_IDoc_LEN - (SAPH_LEN + DC_LEN)) / 1055;

All three of the statements with ASBITSTREAM returns the length of the whole message even though I pointed to a subtree in the message.

Usually that won't work unless you have heavy customization.
The idoc is comprized of
1) 1 EDI_DC40 control record => fixed length (don't remember)
2) N EDI_DD40 segment records => fixed length 1063 bytes. (SData is 1000 bytes)

Don't know where you are grabbing the 1055 number from. Should be 1063... IIRC...

The setup of the IDOC in SAP determines the hierarchy of the segments and max instances for the data. The actual data determines the number of instances.
The DFDL should be set on implicit. If you want to calculate the length you would need to check the number of segments EDI_DD40 times 1063 + length of EDI_DC40

If you are also dealing with the SAPH header you'd have to add that to the total length of the MQ Message payload...

Hope this helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bobbee
PostPosted: Fri Apr 03, 2015 11:15 am    Post subject: Reply with quote

Knight

Joined: 20 Sep 2001
Posts: 545
Location: Tampa

So I hard coded the length, I have no idea what your system is generating but once I set the length in UDP's ad used them for the Headers everything worked fine. The Segment data is 1055. Works perfect.

I think DFDL and Broker are just wonderful things. The great savior of text data. I have a structure of fixed (explicit) data items. I know the length. Why doesn't the parser. Maybe it's tired and too smart. Regardless of 1055 or 1063. If I ask you for the overall length and the items are at least FIXED, you should give it to me. I can do this in COBOL VERY easy!!!!!!! Thanks for your input, but I still don't see an automagical way of getting this length out. I counted bytes and my demo is ready.
Back to top
View user's profile Send private message Send e-mail AIM Address
fjb_saper
PostPosted: Fri Apr 03, 2015 7:51 pm    Post subject: Reply with quote

Grand High Poobah

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

Congrats. Glad it works for you
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DFDL Length of a complex type
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.