Author |
Message
|
aarumguavel |
Posted: Fri Apr 22, 2016 1:55 am Post subject: need to get total files |
|
|
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 |
|
 |
mqjeff |
Posted: Fri Apr 22, 2016 4:01 am Post subject: |
|
|
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 |
|
 |
aarumguavel |
Posted: Fri Apr 22, 2016 4:50 am Post subject: |
|
|
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 |
|
 |
mqjeff |
Posted: Fri Apr 22, 2016 5:01 am Post subject: |
|
|
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 |
|
 |
aarumguavel |
Posted: Fri Apr 22, 2016 5:14 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Fri Apr 22, 2016 5:29 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Apr 22, 2016 6:05 am Post subject: |
|
|
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 |
|
 |
shwetabh WMB |
Posted: Tue Jul 19, 2016 3:43 am Post subject: |
|
|
Novice
Joined: 15 Jul 2016 Posts: 23
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jul 19, 2016 4:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
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 |
|
 |
fjb_saper |
Posted: Tue Jul 19, 2016 4:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
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 |
|
 |
mqjeff |
Posted: Tue Jul 19, 2016 4:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
|