Date: Fri, 17 Mar 2006 11:05:33 -0500
Reply-To: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Subject: Re: SAS query: How to increase the length of variable
Hi Madan,
To recode character values to numeric you have to account for not allowing
text and so on. I wrote a macro aRecodeN.sas, which is available from:
http://home.hccnet.nl/jim.groeneveld/software/SASmacro/aRecodeN.zip
It has pre-recoding, preserving of attributes and names, bulk recoding.
For the reverse you may do something like:
String = TRIM(LEFT(PUT (Value, BEST12.)));
To change string length issue a LENGTH statement before the SET statement.
Regards - Jim.
--
Jim Groeneveld, Netherlands
Statistician, SAS consultant
home.hccnet.nl/jim.groeneveld
On Fri, 17 Mar 2006 16:45:34 +0530, Madan Gopal Kundu
<Madan.Kundu@RANBAXY.COM> wrote:
>Hi,
>
>
>
>I have following two queries:
>
>
>
>i) I want to increase the length of variable of a
>SAS dataset. For example, suppose a table "demo5" contains a variable
>"col1" and it has length 13. Now I have to increase the length of "col1"
>to 25. What should I do?
>
>
>
>ii) How can I change the data type of variable (or
>column) in SAS. For example, "col2" is the variable which is a type of
>numeric and I want to convert it into character type of variable. And
>also vice versa... How can I do that?
>
>
>
>Please reply as early as possible.
>
>
>
>Thanks in advance.
>
>
>
>Madan Gopal Kundu,
>
>Biostatistician
>
>
>
>(i) The information contained in this e-mail message is intended only for
the confidential use of the recipient(s) named above. This message is
privileged and confidential. If the reader of this message is not the
intended recipient or an agent responsible for delivering it to the
intended recipient, you are hereby notified that you have received this
document in error and that any review, dissemination, distribution, or
copying of this message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and delete
the original message.
>
>
> (ii) The sender confirms that Ranbaxy shall not be responsible if this
email message is used for any indecent, unsolicited or illegal purposes,
which are in violation of any existing laws and the same shall solely be
the responsibility of the sender and that Ranbaxy shall at all times be
indemnified of any civil and/ or criminal liabilities or consequences there.
|