...many questions left, about what you REALLY want...
If it's so simple like "substr from right to left" I'd suggest something like
On Tue, 21 Mar 2006 16:31:09 -0800, David L Cassell <davidlcassell@MSN.COM>
>>I want help to substring a variable from right to left, for eg: I have
>>a SAS data set which has a variable Address like.
>>114, Mills Rd, Apt 202
>>345 Morris Drive, Apt 345
>>Chestnut Avenue Apt # 987
>>Is there a way I can create a variable say Type like
>Is there *always* an apartment number?
>Is 'apartment' *always* abbreviated 'Apt' ?
>Is the number always numeric? No occurrences of 'Apartment 3-G'
>or 'Apt B-12' or 'Aptmt R' ?
>Is a six-character string *really* going to be adequate? What about
>'Apt 3407' or 'Apt B-347' ?
>Do you really want to keep that '#' in your third example? What other
>non-numerics show up that you would want to drop?
>Write back to SAS-L and give more detail. This is a non-trivial task,
>and for maximum flexibility I would recommend using the PRX()
>functions to parse the text string. But I'll hold off on more details
>until you can supply them.
>David L. Cassell
>3115 NW Norwood Pl.
>Corvallis OR 97330
>Don�t just search. Find. Check out the new MSN Search!