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 » FileRead node Parsing Issue

Post new topic  Reply to topic
 FileRead node Parsing Issue « View previous topic :: View next topic » 
Author Message
sree4vit
PostPosted: Mon May 16, 2011 10:07 pm    Post subject: FileRead node Parsing Issue Reply with quote

Novice

Joined: 05 Aug 2010
Posts: 21

I have a TDS file which has 1 lakh Records in it, each record is separated by a Line feed.

FileInput node is able to Parse it Record by record by using the below property:

Select Parsed Record Sequence if the file contains a sequence of one or more records that are serially recognized by the parser specified in Message domain. The node propagates each recognized record as a separate message. If you select the Record detection option, the parser specified in Message domain must be either XMLNSC or MRM (either CWF or TDS physical format).

But, the same file is not getting parsed by FileRead node, Problem here is FileRead parses the first record and the control doesn't come back to fetch the Second record and so on. It's not working similar to FileInput.

What could be done to Parse this now using FileRead??

Any Suggestions?
Back to top
View user's profile Send private message
paerjohan
PostPosted: Tue May 17, 2011 10:52 pm    Post subject: Reply with quote

Newbie

Joined: 19 Jan 2010
Posts: 8

It can be done by putting a compute node before and after the FileRead node. Then you use the variables the FileRead node is putting in LocalEnvironment after reading to update some Environment variables which you can use to do propagate in the first compute node until you reach the end of the file (ie, the FileRead node sets LocalEnvironment.File.Read.EndOfFile to TRUE)
The esql in the node before the FileRead node could look like this:

Code:

BEGIN
  SET Environment.File.Offset = 0;
  SET Environment.File.EndOfFile = FALSE;       
  WHILE Environment.File.EndOfFile = FALSE DO
    CALL CopyMessageHeaders();
    SET OutputLocalEnvironment.Destination.File.Offset = Environment.File.Offset;
    PROPAGATE TO TERMINAL 'out';
  END WHILE;
  PROPAGATE TO TERMINAL 'out1';
  RETURN FALSE;
END;


And the esql in the node after could look like this:

Code:

BEGIN
  SET Environment.File.EndOfFile = InputLocalEnvironment.File.Read.EndOfFile;
  SET Environment.File.Offset = InputLocalEnvironment.File.Read.NextRecordOffset;
  RETURN TRUE;
END;
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Mon Dec 30, 2013 6:50 am    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

paerjohan wrote:
It can be done by putting a compute node before and after the FileRead node. Then you use the variables the FileRead node is putting in LocalEnvironment after reading to update some Environment variables which you can use to do propagate in the first compute node until you reach the end of the file (ie, the FileRead node sets LocalEnvironment.File.Read.EndOfFile to TRUE)
...

Thanks a lot for your sample code! It did a real good job in order to process each single line after each other of an input file.
_________________
IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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 » FileRead node Parsing Issue
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.