Date: Tue, 13 May 2003 12:21:25 +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: convert char values to nums
Content-Type: text/plain; charset="iso-8859-1"
Only 5 days ago this issue was discussed on this list. Did you miss that? I
"I have sent my macro ArecodeN, which also takes care to keep as many
attributes as applicable, to Paul. Not too long ago I have presented the
macro on this list as well."
Anyway, you can't change the type of a variable; it is either a numerical
variable or a text variable. My macro makes it (more of them actually) a
new, numerical one and later renames it to the original name(s).
If you want my macro (as a starting point) then drop me a line.
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 is out of inspiration at the moment, and my inspiration comes
out of my computer.
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: Roland [mailto:roland@RASHLEIGH-BERRY.FSNET.CO.UK]
> Sent: 12 May 2003 22:06
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: convert char values to nums
> I feel another macro coming on. Just need a little more "inspiration".
> "Ray Wallace" <email@example.com> wrote in message
> > I am getting variables from a datasource such as ACT score
> and gpa. When
> > queries these fields, proc contents shows that they are
> Chars. I need them
> > to be numeric values.
> > How can a change char values in a field to their
> corresponding numeric
> > values. For example, an if statement for each values would
> do it, but
> > are a lot of different values. I.e., there would be too
> many of these
> > of statements: if gpa eq '3.42' then gpa = 3.42;
> > thanks,