Home > Net >  Can I add a variable date in a ControlM job that will be used in a script?
Can I add a variable date in a ControlM job that will be used in a script?

Time:01-23

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?

CodePudding user response:

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 -

https://blog.dbi-services.com/control-m-em-send-mail-and-alert-window-notification-with-hhmmss-format-with-a-job/

CodePudding user response:

Yes, and variables would be the way to go. In the Control-M job definition you can set, say, PARM1 to be %%ODATE or %

  •  Tags:  
  • Related