11-27-2012 08:36 AM
Is there a way for two DI Studio jobs to share the same parameter? I know I can import a parameter from one job to another, but I need them to be "the same". If I change the parameter in one job, it should also automatically be changed for the other one. The parameter I have in mind would be a very simple numeric one, with a value from 1-10.
11-27-2012 09:16 AM
What do you mean by changing the parameter?
The name, or the (default) value of it?
Parameters are meant to be dynamic, and the value of the parameter is set during run time. How do you set your parameter value?
11-28-2012 03:13 AM
LinusH: I have one job where I've set up a parameter called &delay with the value "2". I then import the parameter into a second job, so that both jobs have identical &delay parameters. The problem is that if I change it from "2" to "3" in one job, it doesn't change in the other. I need to find a way for it to do so.
FredrikE: Thanks, I'll go through the suggestions.
11-28-2012 06:27 AM
As i mentioned, parameters are mainly set in run time.
Setting default values is primarily for testing in DI. If you don't pass parameters into the job, you could as well set a macro variable in the pre-code.
Is it a parameter you really need? By following Frediks suggestions, you don't need parameters, just use macro variables right off.
parameters are used when calling a job from an outer job, linking variable values to parameters, or if your job is deployed as a Stored Process.
11-27-2012 09:30 AM
I guess some of these might help you:
- Set the parameter in the autoexec, either directly with %let or by reading a table and assigning the vairable. Then use it in the two jobs.
- Store the parameter in a table and create a macro that read the table and create the parameter. Put the macro in then pre-code of the two jobs.
- Create a macro that define the parameter using %let and add the macro to the pre-code of the two jobs.
I'm sure you can find more solutions, but some of these should do the job....