How do I use Variables in a Control-M Job and embedded scripts? - INCLUDES VIDEO
Knowledge Article
How do I use Variables in a Control-M Job and embedded scripts? - INCLUDES VIDEO
How do I use Variables in a Control-M Job and embedded scripts?
Control-M/Agent for UNIX and Microsoft Windows
Control-M/Agent for UNIX and Microsoft Windows
All Versions of Control-M/Server
Control-M/Agent for UNIX and Microsoft Windows
Control-M/Agent for UNIX and Microsoft Windows
All Versions of Control-M/Server
How do I use Variables in a Control-M Job and embedded scripts?
Control-M Variables can be used by one of the following methods:
1. Adding them onto the end of the command line of a command line job in the job definition for task types of command.
2. Control-M variables are available as OS variables. By default, this functionality is enabled by the "Autoedit Inline" setting which can be adjusted from the CCM and via the Control-M/Agent utility ctmagcfg. If we set the variable %%MyVariable to "Hello World" we can reference the variable in our script:
On Windows: %MyVariable% will be set to "Hello world"
On UNIX/Linux: $MyVariable will be set to "Hello World"
These are processed after the login script as part of the script that runs with the command line. These will override any variables you may have set before executing the script.