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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sreelalpp
Participant
Posts: 22
Joined: Sun Jan 01, 2006 6:51 am

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

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
csrazdan
Participant
Posts: 127
Joined: Wed May 12, 2004 6:03 pm
Location: Chicago IL

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

Post 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.
Assume everything I say or do is positive
sreelalpp
Participant
Posts: 22
Joined: Sun Jan 01, 2006 6:51 am

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

Post 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
lal
csrazdan
Participant
Posts: 127
Joined: Wed May 12, 2004 6:03 pm
Location: Chicago IL

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

Post 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....
Assume everything I say or do is positive
Post Reply