I am trying to create a long code list where var1 is a string and what it should represent is shown in var2, also a string.
I then would like to store this coding so that I can refer to it later when var1 shows up, var2 will be displayed in the dataset.
This is in a similar fashion to how I would think -encode- would work for strings to a number, except I want to get another string.
Code:
* clear input str5 var1 str27 var2 "one" "the diameter of the earth" "two" "the diameter of venus" "three" "the diameter of jupiter" "four" "the population of paris" "five" "the surface area of england" "six" "the population of phoenix" end
Or if not, I thought to try to make a loop using a global, but couldn't get the syntax right. I have a few thousand unique strings I'd like to "encode", is there a limit to the number of globals you can have?
Thanks for advice...
0 Response to "Encode" a String with another String?
Post a Comment