by cap » Thu Sep 03, 2009 2:35 pm
In my program I am specifying the string name of a certain variable, and then the program computes a variety of tests on that variable, typically using a reference such as %s(&series_name).
But for one particular test, I need to divide two scalars. One of these scalars has a name that is patterned by having some prefix and then the variable name follows (and is not something that can be computed directly from the series). The set of these scalars are all simply hardcoded/written explicitly in my program.
So, when I want to do this computation, I need to specify the division as scalar1/scalar2, and I need to reference the string name of scalar2 as a combination of two other strings, something like
compute scalar2 = "prefix" + &series_name
which creates the name of the proper variable already defined explicitly in my code,
and then I need to do the division with something like
compute value = scalar1 / &scalar2
which would then use the correct value among the several that are defined in my code.
Any ideas?