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 » need to process all rows with no parsing error

Post new topic  Reply to topic
 need to process all rows with no parsing error « View previous topic :: View next topic » 
Author Message
tr
PostPosted: Sun Apr 27, 2014 12:21 am    Post subject: need to process all rows with no parsing error Reply with quote

Novice

Joined: 30 Mar 2014
Posts: 11

I am inserting a delimited file into database.
sample input pattern:
emp name|emp_ID|empdept.

I am able to achieve this using fileinput node and compute. My next requirement is If there is any error in any input row(record), I want to discard all those rows with the same empdept and process rest of the file. But I am finding it difficult because if there is any error in the first input row, broker is stopping the parsing at that particular point and I am not able to process the rest of the file. Please help
Back to top
View user's profile Send private message
Esa
PostPosted: Sun Apr 27, 2014 3:25 am    Post subject: Re: need to process all rows with no parsing error Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

tr wrote:
if there is any error in the first input row, broker is stopping the parsing at that particular point and I am not able to process the rest of the file. Please help


With any error you mean a parsing error? Then you could try to use a dfdl discriminator. But because empdept happens to be the last element of the record, this may be a little difficult. I think the discriminator should return true if you can parse the empdept. That would tell that the record exists and a parsing error further in the record would not cause an exception. It would be better if empdept was the first element of the record.

But I must admit that I haven't tested this myself.

If the errors are not parsing execeptions, a simple exit handler should do the job. But I suppose that's what you already have in your code.
Back to top
View user's profile Send private message
kimbert
PostPosted: Sun Apr 27, 2014 3:00 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
My next requirement is If there is any error in any input row(record), I want to discard all those rows with the same empdept and process rest of the file.
I think that breaks down into multiple requirements:
a) continue processing the file after an error
b) discard any already-processed records that have the same 'empdept'.
c) work out what to do if the error occurs in one of the first two columns ( i.e. before empdept has been parsed ). As an example, what if the first delimiter gets missed out?

a) is fairly easy - model the 'record' as a choice of 'good record' and 'invalid record'. If the first branch of the choice fails, DFDL will back out and try the other branch. If you make the second choice branch a simple string field then it is not likely to throw any errors ( unless your data contains invalid characters or you set the character encoding wrongly ).
After making this change, invalid records will appear in the message tree with a different name, and you can write whatever logic you need for b) and c).
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
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 » need to process all rows with no parsing error
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.