Page 1 of 1

Check Number of file in sequence.

Posted: Mon Mar 18, 2013 8:01 am
by hi_manoj
Hi,

I have a sequence. Sequence starts with a loop followed by a sequencer stage. From sequencer stage I have 3 file watcher stage, out of the 3 file watcher

file watcher 1 -- looks for exact file name (abcd.txt)
file watcher 2 -- looks for file pattern (xyz*.txt), can be one or more files.
file watcher 3 -- looks for file pattern (mnop*.csv) should exactelly have 4 files to start the load job to run.

for file watch 2 and 3
------------------------

I have suggested to implement 2 script and create 2 trigger file (one for each) and make our file watcher job to look at the trigger file rather than the actual file. But I was told not to use any such script and try in datastage stages only

Is there any stage in sequence which can help me to solve this. I think user variable activity stage can help me, but I have not done this before could any body help me to implement this logic.

Regards
Manoj

Posted: Mon Mar 18, 2013 8:28 am
by chulett
Not sure why you felt the need to start a new post. For those following along, this is a continuation of this topic.

Unless something has changed that I'm not aware of, the FileWatcher stage does not support wildcards. Hence the suggestion to watch for a specific 'trigger' file.

Posted: Mon Mar 18, 2013 8:40 am
by hi_manoj
Thanks Chulett,

I was not sure whether I can continue with the old one or not so start a fresh one.
Yes, file watcher stage does not accept wildcards. And I can not use shell script to check and create trigger file and make the file watcher stage wait for the trigger file.

I have to try other approach. That is way I am trying with User Variable activity stage

Regards
Manoj

Posted: Mon Mar 18, 2013 9:36 am
by hi_manoj
Hi All,

Is it possible to achieve this using User Variable Activity stage (UVA) or any combination of sequence stages. What ever i found is, UVA can only store a value in variable.

In my case I have to find a file pattern in a directory and number of file also. Can it be possible to check all this in UAV.

Regards
Manoj

Posted: Mon Mar 18, 2013 9:51 am
by chulett
hi_manoj wrote:I was not sure whether I can continue with the old one or not so start a fresh one.
Of course you can. It's your topic and the same topic. :?

Best way to do this would be via a script, otherwise are you "allowed" to write a BASIC routine and leverage that in your Sequence? It could do the equivalent of the script - issue the wildcard check, count the files, wait, repeat, etc etc - without actually being a script.