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 get total files

Post new topic  Reply to topic
 need to get total files « View previous topic :: View next topic » 
Author Message
aarumguavel
PostPosted: Fri Apr 22, 2016 1:55 am    Post subject: need to get total files Reply with quote

Newbie

Joined: 07 May 2015
Posts: 5

Hi All,

I need to get number of files (files count) in particular directory using wmb flows.

Thanks for support
Arumugavel M
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 22, 2016 4:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why?

You certainly don't need it to read every file in that directory.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
aarumguavel
PostPosted: Fri Apr 22, 2016 4:50 am    Post subject: Reply with quote

Newbie

Joined: 07 May 2015
Posts: 5

Hi,

Actually my requirement is need to read all files and write into one file at every day evening.

I have checked batch processing sample code, but in that is file count is hard coded as 3.

but in my situation not known how many files arrival in that particular location.

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 22, 2016 5:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You still don't need to know how many files you have.

You merely need to know either when to start processing all files or when you have reached the last file.

If you are using the FileRead node, you can use propagate to send messages to the file read node, and some variable to tell if the fileoutput read something.

Code:

foundAFile = true
while foundAFile is true:
     foundAFile = false
     propagate
end
Then something downstream of the fileread sets foundAFile to true. If that doesn't happen, then the loop ends.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
aarumguavel
PostPosted: Fri Apr 22, 2016 5:14 am    Post subject: Reply with quote

Newbie

Joined: 07 May 2015
Posts: 5

Thanks mqjeff!

But I am using wmb 6.1 in that no file read node.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 22, 2016 5:29 am    Post subject: Reply with quote

Grand High Poobah

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

aarumguavel wrote:
But I am using wmb 6.1 in that no file read node.


So you tell however decided to take the risk of using out of support software that the risk just failed to come off.

One option (aside from upgrading to a supported version) is to read the files as they arrive with a FileInput node, copy the contents to a database and "in the evening" copy the accumulated contents of the database to the output file.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 22, 2016 6:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

aarumguavel wrote:
But I am using wmb 6.1

Find another job.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
shwetabh WMB
PostPosted: Tue Jul 19, 2016 3:43 am    Post subject: Reply with quote

Novice

Joined: 15 Jul 2016
Posts: 23

Input file polling and message flow scalability in the link http://www.ibm.com/developerworks/websphere/library/techarticles/0806_mcmullan/0806_mcmullan.html
Use of Polling Intervals
+
Proper record detection method in FileInput node
+
Shared Variable and use of Atomic in esql might help you find the number of files.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jul 19, 2016 4:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

shwetabh WMB wrote:
Input file polling and message flow scalability in the link http://www.ibm.com/developerworks/websphere/library/techarticles/0806_mcmullan/0806_mcmullan.html
Use of Polling Intervals
+
Proper record detection method in FileInput node
+
Shared Variable and use of Atomic in esql might help you find the number of files.


Does Broker 6.1 support ATOMIC operations in esql? It's not possible to find out, unless one has a copy of 6.1 lying around, because the documentation for 6.1 is no longer available through IBM, at least in a knowledge center format (there might be pdfs).
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 19, 2016 4:30 am    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
shwetabh WMB wrote:
Input file polling and message flow scalability in the link http://www.ibm.com/developerworks/websphere/library/techarticles/0806_mcmullan/0806_mcmullan.html
Use of Polling Intervals
+
Proper record detection method in FileInput node
+
Shared Variable and use of Atomic in esql might help you find the number of files.


Does Broker 6.1 support ATOMIC operations in esql? It's not possible to find out, unless one has a copy of 6.1 lying around, because the documentation for 6.1 is no longer available through IBM, at least in a knowledge center format (there might be pdfs).


IIRC Atomic was available in 6.0
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jul 19, 2016 4:39 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Huh. I don't remember v6.0, but http://www.ibm.com/support/knowledgecenter/SSKM8N/mapfiles/docolderversions.html does show BEGIN ATOMIC.


_________________
chmod -R ugo-wx /
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 get total files
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.