Date: Wed, 25 Sep 2002 11:54:38 +0200
Reply-To: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject: Re: Substr Question
Content-Type: text/plain
Hi Dave,
Your own attempt actually is all right, as is the solution offered by
Michael Braten, but I suspect you to expect a numeric variable (a value to
calculate with) instead of a character variables with those digits. So:
NumVar1 = INPUT (substr(var1,4), BEST12.);
Regards - Jim.
--
Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070
senior statist./data man. P.O. Box 1 fax. +31 412 407 080
J.Groeneveld@ITGroups.com 5350 AA BERGHEM, NL www.imrotramarko.com
My computer does what I tell it to do; I do tell myself to believe that.
Notice of confidentiality: this e-mail may contain confidential information
intended for the addressed recipient only.
If you have received this e-mail in error please delete this e-mail and
please notify the sender so that proper delivery
can be arranged.
> -----Original Message-----
> From: dave e [SMTP:deckles@WHARTON.UPENN.EDU]
> Sent: Tuesday, September 24, 2002 7:09 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Substr Question
>
> If I have a matrix that looks like this...
>
> Var1 Var2
> La_1 7
> La_59 85
> La_300 54
> La_2209 100
>
>
> How can I make a new matrix that looks like....
>
> Var1 Var2
> 1 7
> 59 85
> 300 54
> 2209 100
>
> That is, how can i remove the "La_"'s? I have tried using
> substr(var1,4) but that does not seem to work. Any suggestions?
> Thanks in advance
|