Page 1 of 1

Make Parameters Read Only?

Posted: Wed Mar 07, 2018 8:27 am
by jackson.eyton
Does anyone know how I can make a parameter set read only? I attempted exporting said parameter to a dsx file and editing the Readonly field to = 1 and reimporting that but I can still edit the parameter set :-(

Posted: Wed Mar 07, 2018 11:35 am
by PaulVL
Why not change the permissions on the parameter set file itself?
Leave owner as RW but everyone else is R.

If you are the author of the parameter set... you will always need Write authority.

Posted: Wed Mar 07, 2018 11:46 am
by jackson.eyton
The end goal is to try and avoid a simple mistake we sometimes make where we package up a series of jobs and we might leave the option enabled to bring in dependencies. Welp in the case of one of our parameter sets that includes the database name and some connection details. When we deploy the package to our test project that parameter set then points to the dev database because we overwrote the parameter set for test. Really its our own fault but it can be frustrating and easy to miss. I figured if we made the parameter set RO then perhaps it wouldn't be overwritten during deployment. I am unsure how to change permissions on the parameter set itself.

Posted: Wed Mar 07, 2018 5:38 pm
by PaulVL
Or you could take a concept change... and have 1 parameter set with 3 sets of values. DEV values, TEST values and PROD values. Simply use the correct set in the correct environment via parameters being passed to the job.

Posted: Fri Mar 09, 2018 8:22 am
by FranklinE
Point of clarification: are your parameters locally set for default value in the file? If that's true, I strongly recommend "elevating" the local parameters to environment variables.

This is standard practice in our elevation protocols. Any parameter that is based, even indirectly, on the syslevel is defined in Administrator under User Defined, and the default value in any job is $PROJDEF.

Sample command line for batch update to environment variables:

Code: Select all

${DSHOME}/bin/dsadmin ${ADMIN_CLI_ARGS} -envset ${VARNAME} -value "${VARVALUE}" ${PROJ_NAME}
As a workaround, we also use export to/import from file in the environment variables window in Administrator.

Posted: Fri Mar 09, 2018 11:18 am
by jackson.eyton
Thanks gentlemen, not sure why I did not think of that, I will need to edit every job that uses the parameter to use the environment variable but that is absolutely the correct route to go. Thanks!!!

Posted: Fri Mar 09, 2018 3:01 pm
by FranklinE
https://en.wikipedia.org/wiki/Spaghetti_code

"Spaghetti code is a pejorative phrase for unstructured and difficult to maintain source code, broadly construed. Spaghetti code can be caused by several factors, such as volatile project requirements, lack of programming style rules, and insufficient ability or experience."

Take it from an old mainframe developer: the more work you do standardizing parameters, the less work you do when it turns up with a defect.

"We should return to the ship and nuke the site from orbit. It's the only way to be sure."

:P