Page 1 of 1

Parameter Usage

Posted: Thu May 08, 2008 9:12 am
by WoMaWil
Sometimes it could be of interest to reduce those parameters which aren't any more used at any place it the Job. Is there a simple way to make a usage analyse if a parameter is still used?

Posted: Thu May 08, 2008 10:27 am
by PhilHibbs
Personally I'd do this on a .dsx export of the project - I have a script that does a daily export of the whole project and a bunch of scripts that do various analysis tasks such as looking for file names with spaces in, and the hash keys for certain hashed file types.

Posted: Thu May 08, 2008 10:29 pm
by tsn
simple way to do this. export the job. have the parameter list in a file or in the variable of a script, in the same script look for the parameter are used in multiple places inside thejob or not. if the count is 1 then you are not using it. so that you remove that from your job.

Posted: Thu May 08, 2008 10:31 pm
by ray.wurlod
So long as you're very careful to look everywhere! A parameter name can appear in an expression, but is only a parameter name if it is not enclosed within quotes (in which case it is a literal string).

Posted: Thu May 08, 2008 10:32 pm
by tsn
simple way to do this. export the job. have the parameter list in a file or in the variable of a script, in the same script look for the parameter are used in multiple places inside thejob or not. if the count is 1 then you are not using it. so that you remove that from your job.

Posted: Fri May 09, 2008 2:20 am
by WoMaWil
Thank you all for your input. I thought it might give a more easy way of doing by doing a lookup into the metadata.

Posted: Fri May 09, 2008 6:42 am
by PhilHibbs
ray.wurlod wrote:So long as you're very careful to look everywhere! A parameter name can appear in an expression, but is only a parameter name if it is not enclosed within quotes (in which case it is a literal string).
Something that looks like a parameter usage, such as #PARAM# or #$ENVVAR# is unlikely to appear in a literal string. I suppose if your projects do have literal strings like this in them, then you would need to take special care not to mistake a literal string for a parameter usage, for instance if you have jobs that process DataStage job design information. Most projects I guess would not experience any false positives in this manner. What you don't want is parameter usages to be missed out, because then you might delete a parameter that is used. Can you think of any instances where a parameter would not be immediately obvious like #PARAM#?

Posted: Fri May 09, 2008 4:03 pm
by ray.wurlod
Yes. The "#" characters do not appear when a parameter name is used in an expression.

Posted: Fri May 09, 2008 7:30 pm
by kduke