Dear Statalist,

I would like to be able to select only those cases in "subp" variable whose value ends with "-1" at the end. Because the variable "subp" is a string variable, I could not find an efficient code. I would really appreciate if you could help me with a suitable code to solve this problem. Thanks. Ramu

. tab subp

subp | Freq. Percent Cum.
------------+-----------------------------------
15-0394-1 | 1 0.91 0.91
15-0394-2 | 1 0.91 1.82
15-0394-3 | 1 0.91 2.73
15-0453-1 | 1 0.91 3.64
15-0453-2 | 1 0.91 4.55