I have a ControlM job that launches a script for a BDD extraction for an interval depending on the system date. For example: a script being launched daily to make an extraction for the users logged in the past 24h. Right now, the job is scheduled at a specific time and the script knows to substract the 24h timeframe. The script uses the system date, but I can change that to a parameter.
Can I add a variable in ControlM that will allow me to make the extraction for any given date (my choice) without modifying/creating the job each time?
32 Answers
Control-M loves variables. Check out the LIBMEMSYM option, you can use defined text file to hold a list of variables. Simply echo out your desired value into the LIBMEMSYM and get the result that way.
Also consider setting the variable directly via the ctmvar utility (works for Global, Smart folder and named pool variables). Let me know if you want to use ctmvar and I will post an example.
Some good pointers in this article too -
1Yes, and variables would be the way to go. In the Control-M job definition you can set, say, PARM1 to be %%ODATE or %%DATE (the added 'O' means Order Date, i.e. the original scheduled date) and then use $1 in your script. $1 should then resolve to that date.
There are various date variables available out-of-the box with Control-M and they can be concatenated together for something more tailored to your needsy. You can also manipulate the dates via SUBSTR and CALDATE options in Control-M.
Let me know if you need some examples.