Page 1 of 1

Passing on System Variables from control-M tool to a script

Posted: Mon Jun 04, 2007 3:46 am
by sreelalpp
Hi All-

Can anybody help me out!!

Requirement:
I need to get the system variables from control-M tool such as Order date,OredrId for any particular datastage job and pass it on to some script
ex : Runanyjob.ksh. as input parameters.
In my case the datastage server and Control-M server are different though.

Regards
Raghu/Sree

Posted: Mon Jun 04, 2007 5:46 am
by kduke
We use a script like this. We have all parameters in text files that end in .prm. There is a global parameter file and one for each job. There can be one for each parameter. We have a script to populate each of these. The global one is built by all the defaults for all the parameters in every job. The parameter level one is usually for a specific job at run time.

JobName_ParamName.prm
ParamName=ParamValue

These are all fairly simple scripts.

Re: Passing on System Variables from control-M tool to a scr

Posted: Mon Jun 04, 2007 11:37 am
by csrazdan
sreelalpp wrote:Hi All-

Can anybody help me out!!

Requirement:
I need to get the system variables from control-M tool such as Order date,OredrId for any particular datastage job and pass it on to some script
ex : Runanyjob.ksh. as input parameters.
In my case the datastage server and Control-M server are different though.

Regards
Raghu/Sree
You can do this using AutoEdit Control-M variables. Following are the steps:

1. You have to create Job Type Control-M component. Command type Control-M component my not work with AutoEdit Control-M variables.

2. In the parameter tab of Control-M component you can define PARAM1, PARMAM2 as parameters.

3. Define the values of PARAM1, PARMAM2 using AutoEdit Control-M variables.

4. In your script Runanyjob.ksh accept Control-M varaibles as command line arguments. The vales will be accessible as $1 and $2

5. Pass these vales to DataStage job using dsjob utility.

Hope it helps.

Re: Passing on System Variables from control-M tool to a scr

Posted: Tue Jun 05, 2007 6:32 am
by sreelalpp
By "Job Type Control-M component" do you mean a controlM job which executes a Ds job ?

Is this the only way, because in the controlM window that I have, the parameter tab is inactive.


-Thanks,
Sreelal

Re: Passing on System Variables from control-M tool to a scr

Posted: Tue Jun 05, 2007 11:15 am
by csrazdan
sreelalpp wrote:By "Job Type Control-M component" do you mean a controlM job which executes a Ds job ?

Is this the only way, because in the controlM window that I have, the parameter tab is inactive.


-Thanks,
Sreelal
Yes. I'm using component to avoid confusion with DataStage job.

I'm not sure what you are looking at. If the parameter tab is inactive, I guessing that you would be looking at active job in Control-M ESG console. What it means that job is already scheduled to run. You can still modify this Control-M component but first you will have to right click on it and put it on hold. (You should have permission to put jobs on hold and modify). However changes made to Control-M component in ESG will be lost for next run as it does not update metadata.

If you want to make this change permanent, download this component from ESG to Control-M Desktop, modify it and upload it back to Control-M ESG. The changes will take effect from the next run.

Hope it helps....