2 of 2 people found this helpful
You can use wild cards in the filename to watch.
* = any number of characters
? = single character
If you know that the date in the file is always current_date, and you don't want to use wild cards for the date because that may pickup a previous day's file, you can use one of the Control-M System Variables for date.
For current date in YYYYMMDD format: prlv_%%$DATE.* (the dot is to concatenate values so is required in this example)
For current date in YYMMDD format: prlv_%%DATE.*
For Control-M Order Date (=Business Date) in YYYYMMDD format: prlv_%%$ODATE.*
For Control-M Order Date (=Business Date) in YYMMDD format: prlv_%%ODATE.*
In all of the above, Control-M resolves the variable to a value at the time the job gets submitted and then the file watcher looks for that value.
prlv_%%$DATE.* will be resolved to prlv_20200710* and the value being searched for will be prlv_20200710*.
You can read more about Control-M Variables here: Control-M 22.214.171.124 Control-M Documentation - Control-M - BMC Documentation
Especially look at the sections "Control-M system variables", "String Expressions" and "Variable functions" (there is a function that lets you make date calculations (e.g. today's date -1)).
Thanks, it works!
Regarding the path file, need to replace 'space' character. So I used '?' but it doesn't work. Did you have an idea?
If I'm not mistaken the wild cards of * and ? can only be used in the file name and not the path.
But, I thought Control-M will automatically put double-quotes around the path so that should handle spaces.
If you find it doesn't, you can try to use %%BLANK1 which should resolve to 1 blank. (you can use %%BLANK2 for two blanks and up to 214)
Path/File to Watch: C:\My%%BLANK1.Files\prlv_%%$ODATE.*
Should resolve to: C:\My Files\prlv_20200710*