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 » Ignoring newline chars at EOF while creating MDM message Set

Post new topic  Reply to topic
 Ignoring newline chars at EOF while creating MDM message Set « View previous topic :: View next topic » 
Author Message
Hulisan08
PostPosted: Mon Jun 04, 2012 11:48 pm    Post subject: Ignoring newline chars at EOF while creating MDM message Set Reply with quote

Newbie

Joined: 03 Apr 2012
Posts: 6

Hi,

I have created a MDM message set based on tagged fixed length messages, and it works perfectly for the data provided. How ever, the external system is sending some newlines/spaces after the message contents(after the last footer element) which is causing the messageParsing to fail.

Is there a way to ignore these extra lines/spaces?

Thanks in Advance.
Back to top
View user's profile Send private message
kash3338
PostPosted: Tue Jun 05, 2012 1:37 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

You can either ask the external application to remove the extra line and send the message or add another element in your message set at the end to hold the extra line and ignore during your coding.
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jun 05, 2012 2:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kash3338 wrote:
You can either ask the external application to remove the extra line and send the message or add another element in your message set at the end to hold the extra line and ignore during your coding.




Or you can read the message as blob, trim the trailing line feeds, and then parse using your message set.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jun 06, 2012 1:03 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

kash3338's solution can be implemented like this:
- Add one more sequence group ( not complex element ) as the final member of the outermost complex type.
- Set Data Element Separation to 'Use Data Pattern'
- Add a local element with name 'trailingWhitespace' to the sequence
- Set the element's minOccurs property to 0
- Set the element's Data Pattern property to ".*" ( the " are not included the value that you enter in the property )

I haven't tested this, but it should be possible to make it work.

For users of WMB v8 who might read this: The DFDL parser provides the %WSP; mnemonic for exactly this purpose. Just append %WSP; to the 'separator' property for the outermost sequence.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Sun May 12, 2013 10:30 pm    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

kimbert wrote:
For users of WMB v8 who might read this: The DFDL parser provides the %WSP; mnemonic for exactly this purpose. Just append %WSP; to the 'separator' property for the outermost sequence.

I am on v8 and the same applies when writing to a file ?

I am building a CSV record which is modelled in a DFDL. Everything is right except the newline that is embedded between two output records. I have set separator property to %WSP;. BTW, does %WSP*; mean multiple occurrences of white-space ?

One other factor that should (probably) be considered is the FileOutput node where the CSV record flows to. Under 'Records and Elements' tab, I have set 'Record definition' as 'Record is Delimited Data' and 'Delimiter' is 'Broker System Line End'.
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Tue May 21, 2013 8:46 am    Post subject: Newline added at end of CSV record from DFDL. Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

I am writing two output records by setting different CSV fields of first, OutputRoot.DFDL.A.B and then by creating a lastChild of A with name as B. Once both these are prepared, they are propagated. I keep getting a new line after every pair of these records.

I have tried altering various settings (terminator, separator) at various level (outermost element name, sequence, etc.) with values such as %LF; %CR; %WSP*; etc. but, no luck.

How do I get around this issue ?
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
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 » Ignoring newline chars at EOF while creating MDM message Set
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.