HOW TO PASS PARAMETER TO SCRIPT

All questions about Control-M jobs definitions
Post Reply
User avatar
brownbag
Nouveau
Nouveau
Posts: 161
Joined: 11 Oct 2007 12:00
Location: Melbourne

HOW TO PASS PARAMETER TO SCRIPT

Post by brownbag » 26 Oct 2010 2:32

I wish to execute a script from a shout within the Steps panel of a job. I can do this using a shout destination of type P (program). That part is easy, but the difficult bit is passing a parameter to the script from the job.
I was hoping to be able to pass a variable in the message of the shout but that doesn't seem to work.
The other option is to be able to code the script somehow to extract the value of a global variable using ctmvar. Anybody know how to do this?
:cry:

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 26 Oct 2010 9:34

Brownbag,

The script you coded as the physical dest of the logical dest you shout to receives the following :
1) the nodeid of the job
2) the full text of the shout message
3) the urgency of the shout

The message text can include any system or user autoedit variable.

This means you can process as a parameter any word of the text message, provided you parse the text of the message, which is sent as one parameter but which is received as n parameters, n being the number of words of your message text.

If you message contains three words, lets say %%ORDERID %%JOBNAME %%TIME then the submission time will be processed as the 4th parameter of your script.

Hope this helps
Nicolas Mulot

Code: Select all

[url][/url]

User avatar
brownbag
Nouveau
Nouveau
Posts: 161
Joined: 11 Oct 2007 12:00
Location: Melbourne

HOW TO PASS PARAMETER TO SCRIPT

Post by brownbag » 27 Oct 2010 1:48

Thanks Nicolas,
That's very useful.
:)

Post Reply