I need my Control-M File Watcher job to pick up a file having a specific type of file pattern name

650 views Asked by At

I have files of two file pattern

HUB.SG.20220902.01.P

and

HUB.SG.20220902.001.P

in the second file name the .001. will keep on incrementing like the next file will be HUB.SG.20220902.002.P . . . HUB.SG.20220902.100.P and so on

but the first file will always be of the file name pattern as : HUB.SG.20220902.01.P

I want my File watcher job to just pick file of the pattern: HUB.SG.20220902.001.P and not of the pattern: HUB.SG.20220902.01.P

If I add in my job the filename = "path/HUB.SG..**.P" - it picks up files of both the filename pattern.

How do I resolve this so my file watcher job just picks up file of the filename pattern : "HUB.SG.20220902.___.P"

2

There are 2 answers

0
Mark On

Use one * to match on one or more characters (including nothing).

Use ? to match single character. In your example you would use HUB.SG.20220902.???.P

However, you can use Control-M system variables for the date (should you be looking for today's dated file as standard). In that case, use %%$ODATE in place of 2022090 etc.

0
user_0 On

You can use a pattern like:

path/HUB.SG..**.???.P