Check Number of file in sequence.

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Check Number of file in sequence.

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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
Manoj
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply