How do you PASS ARGUMENTS TO THE SCRIPT in Control-M

A lot of scripts ans example to extract information from Control-M tools.
Post Reply
User avatar
Frankma52
Nouveau
Nouveau
Posts: 3
Joined: 09 Oct 2007 12:00

How do you PASS ARGUMENTS TO THE SCRIPT in Control-M

Post by Frankma52 » 07 Aug 2013 4:28

CONTROL-M/Enterprise Manager 7.0.00 400

I want to be able to kick off a control m job to kick off a script and use parameters to determine

• which machine to run it on
• pass arguments to the script

the arguments are coming from WebSphere API and we are able to add conditions from the API successfully but we are looking at a process for adding the arguments to each individual run of the script triggered in Control-M.

User avatar
Kelly
Nouveau
Nouveau
Posts: 10
Joined: 25 Sep 2010 12:00

Post by Kelly » 16 Aug 2013 7:46

Hi,

If you want to pass parameters from a Control-M job definition to a script then you may use auto edit variables in set tab of the jobs.

In case you want system parameters to be picked and a job needs to be created with those values, then you may use ctmcreate utility to achieve so.

User avatar
Nightwatchrenband
Nouveau
Nouveau
Posts: 28
Joined: 24 Jul 2012 12:00
Location: Long Beach, CA

How to...

Post by Nightwatchrenband » 16 Aug 2013 9:03

Basics of passing parms to scripts/commands:
IF you are running a "Command" rather than a job, just put the %%var in your command line.
For an imbedded script in your "OS" job. First go to the "Set" tab in your job an create PARM1 and give it a value. Then use "$1" in your unix script or %1 in Windows bat, and you will get whatever you placed in your PARM1. You may do the same thing for PARM2 and so on.
BUT you seem to be getting the values from somewhere and want to create the PARM1 "on the fly". You will have to create a global or table variable using the control-m "setvar" command in one control-M job. And then in the job that runs the script Set tab will set PARM1 to %%WhatYouSet. It is round-about, but it will work.
Now, how to set the Execution node. I cannot help you there. %%vars will NOT work in the Execution Node ID field.
You COULD have the job which sets the %%WhatYouSet parm set a Condition which releases a cyclic job just waiting to run on that server. BUT you would have to have one cyclic job waiting for each possible server. How many possilbe servers? The overhead of cyclic jobs waiting for a condition is pretty low so this might work for you.

Post Reply