|Date: ||Tue, 5 Jun 2001 17:40:42 -0400|
|Reply-To: ||"Dr. Frank Thomas" <FrankThomasFT@NETSCAPE.NET>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||"Dr. Frank Thomas" <FrankThomasFT@NETSCAPE.NET>|
|Subject: ||Re: change from numerical to string by syntax|
|Content-Type: ||text/plain; charset="ISO-8859-1"|
thank you. The best solutions are the easiest ones.
Jeff Ackerman <jma157@PSU.EDU> wrote:
> At 09:11 AM 6/5/2001 -0400, you wrote:
> >I have to change the character of a variable from numerical to string. You
> >can do this manually, simply changing the content of the type column in
> >variable view. However, I want to repeat that several times and I like to
> >memorize the command. There is no syntax result from this manipulation in
> >the output viewer if you show commands in the output. And you can not
> >paste the syntax. Is there any other way ?
> >Frank Thomas
> To convert numeric variable to string:
> ** First make a new string variable **.
> ** The a8 is the format - max 8 characters **.
> String str_var (a8).
> Compute str_var = string(num_var,F8.1).
> ** the 8.1 is the rounding .1 rounds to one decimal point **.
> ** To delete the original variable **.
> Match Files file = */drop= num_var.
> Jeff Ackerman
> Dept. of Sociology
> 211 Oswald Tower
> University Park, PA 16802
Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/