| Date: | Tue, 15 Sep 2009 06:51:09 -0700 |
| Reply-To: | RolandRB <rolandberry@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | RolandRB <rolandberry@HOTMAIL.COM> |
| Organization: | http://groups.google.com |
| Subject: | Re: Finding first numeric in a text and taking into another
column: |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
On 15 Sep., 08:38, shashi <shashi2...@gmail.com> wrote:
> Finding first numeric in a text and taking into another column:
>
> Can anybody suggest how to find the first numeric of a column and
> taking into another column?
>
> The text looks like:
>
> A5apple7
> cc8mango
> 10pomegranate
>
> First numerics in the above text column should be taken into another
> column like:
>
> 5
> 8
> 10
>
> Any help will be much appreciated.
>
> Thanks,
> Shashi
This is converting it into a sas numeric.
data _null_;
str="A5apple7";
num=input(scan(translate(str," ",compress(str,"0123456789")),1," "),
6.);
put num=;
run;
|