Make Parameters Read Only?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jackson.eyton
Premium Member
Premium Member
Posts: 145
Joined: Thu Oct 26, 2017 10:43 am

Make Parameters Read Only?

Post 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 :-(
-Me
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post 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.
jackson.eyton
Premium Member
Premium Member
Posts: 145
Joined: Thu Oct 26, 2017 10:43 am

Post 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.
-Me
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post 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.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
jackson.eyton
Premium Member
Premium Member
Posts: 145
Joined: Thu Oct 26, 2017 10:43 am

Post 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!!!
-Me
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply