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 » File Read Input Node

Post new topic  Reply to topic Goto page 1, 2  Next
 File Read Input Node « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Mon Apr 01, 2013 9:48 am    Post subject: File Read Input Node Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

I have a flow triggered by files on system directory.

Any one has idea how to read 1st record ONLY?
I have filez over 2GB and need to read 1st record only.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
lancelotlinc
PostPosted: Mon Apr 01, 2013 9:50 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Two flows: flow A and flow B. Flow A breaks apart the file into bite-sized chunks. Flow B consumes the chunks.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
scravr
PostPosted: Mon Apr 01, 2013 10:07 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

I need to read 1st record only. NOT the whole file.

File is greater that 2GB
How would you configure flowA RecordDetection?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
lancelotlinc
PostPosted: Mon Apr 01, 2013 10:12 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

With a record terminator/delimiter.

You're not new, so you must know how to use Google to search the InfoCentre, right?

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac55425_.htm
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
scravr
PostPosted: Mon Apr 01, 2013 10:19 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

PLEASE DO NOT ANSWER IF YOU DO NOT READ THE QUESTION !!!


I am not interested in reading all records in file. File may have over 10milion records. reading all is time consuming.
I am looking to read first reaord only, get files name only.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
adubya
PostPosted: Mon Apr 01, 2013 10:25 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

The FileRead node allows you to specify a Record Selection Expression which I believe (from reading the Infocenter, I've not used it) can be set to only match the first record i.e. set the expression to:-

Code:
$OutputLocalEnvironment/File/Read/RecordNumber=1


Obviously the FileRead node is intended to have an input terminal and not be an initial input node but you could trigger it via a timer node + compute node or similar.

Or if all that's too much grief then use a JCN and access the Java file io library.
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Mon Apr 01, 2013 10:31 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

scravr wrote:
PLEASE DO NOT ANSWER IF YOU DO NOT READ THE QUESTION !!!


I am not interested in reading all records in file. File may have over 10milion records. reading all is time consuming.
I am looking to read first reaord only, get files name only.


I read the question, and gave you the answer, which is in the InfoCentre. What about my answer is misleading or pointing to the wrong information?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
scravr
PostPosted: Mon Apr 01, 2013 10:38 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

I have FileInput node that gets error when reading whole file over 2GB.
So I like to read just part of it (or 1st reord only).

No interest in parsing (or spliting by recorsd) and reading 1 rec at a time.

and YES, I read the infocenter many times.

Any ideas?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Vitor
PostPosted: Mon Apr 01, 2013 10:39 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
I read the question, and gave you the answer, which is in the InfoCentre. What about my answer is misleading or pointing to the wrong information?


Your answer (and the included link) is how to split a file into records. The question is how, having identified the record layout & format, you only read the first one and not the entire contents of the file.

So neither misleading nor pointing to wrong information, but answering a different question to that asked IMHO.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
adubya
PostPosted: Mon Apr 01, 2013 10:47 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

scravr wrote:
I have FileInput node that gets error when reading whole file over 2GB.

Not surprised, don't use Whole File mode for this particular requirement.

Quote:

So I like to read just part of it (or 1st reord only).

No interest in parsing (or spliting by recorsd) and reading 1 rec at a time.

If you want the first record then you must do some spliting. I made a suggestion (above) as to how the FileRead node could be configured to only propagate the first record. Don't you think that will work ?


Quote:

Any ideas?


Yes, see above
Back to top
View user's profile Send private message Send e-mail
scravr
PostPosted: Mon Apr 01, 2013 10:54 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

we are talking about FileInput Node
Back to top
View user's profile Send private message Send e-mail MSN Messenger
adubya
PostPosted: Mon Apr 01, 2013 10:57 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

scravr wrote:
we are talking about FileInput Node


I don't think what you want to do is possible with the FileInput node, hence my suggestions around the FileRead node or using a JCN.
Back to top
View user's profile Send private message Send e-mail
zpat
PostPosted: Mon Apr 01, 2013 1:07 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

You say you want to read part of it, without defining what that might be.

What are the record delimiters in the file?
Back to top
View user's profile Send private message
Esa
PostPosted: Mon Apr 01, 2013 11:27 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Set Record detection so that you can process the file one record at the time, as instructed above.
Set Retry mechanism to Failure (it's the default) and select the best alternative of Action on failing file, for example Add Time Stamp and Move to Backout Subdirectory

After processing the first record, put out the results outside transaction and then just throw an exception.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 03, 2013 11:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

If you only want to get the filename of the file being read, then why do you need to access the contents of the file at all. Doesn't the FileInput node put that information into the LocalEnvironment tree?

If you have some other requirement then please explain exactly what you want your message flow to do. If you are getting an error from the message flow then quote the error message - in full.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » File Read Input Node
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.