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.
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?
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.
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.
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....
//Fredrik
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.