Date: Wed, 20 Nov 2002 21:49:33 GMT
Reply-To: Fraser Neiman <fn9r@VIRGINIA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Fraser Neiman <fn9r@VIRGINIA.EDU>
Organization: University of Virginia
Subject: character string parsing
Hi Folks,
I have a simple character string parsing problem that I am too
simple to solve. I have a character variable called context
whose values consist of a string of numbers, sometimes followed by some
letters, and then sometimes followed a single number. I need to
some code that will identify those cases where the right most
character is a number and then output all the numbers and
characters to left. So for example, 746AD1 would become 746AD;
752B2 would become 752B; 752 would be left unchanged. Ive
appended a listing of typical context values.
Thanks for any help.
Best, Fraser
context
792B
736D
736E
792C1
746AD1
753C
785AA2
779AC2
764AA3
753AA3
737TPS
764AB2
746AB1
746AB2
746AC1
746AC3
746AC4
746AD3
746AD4
796AA1
796AA2
796AB2
752B2
752C5
752
752AA1
752AA2
752AA3
752AA4
752AB1
|