LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2004)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 4 May 2004 09:12:45 +0200
Reply-To:   Spousta Jan <JSpousta@CSAS.CZ>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Spousta Jan <JSpousta@CSAS.CZ>
Subject:   Re: syntax to change numeric to character
Content-Type:   text/plain; charset="iso-8859-2"

Hi Carol,

If you will do it only few times, do it without syntax:

- In SPSS Data Editor, Variable View, change Type from Numeric to String for the first variable

- Copy (Ctrl-C) the word String from the cell, select Types of all other variables and paste "String" (Ctrl-V) - it changes them all

- If needed, you can paste number "4" to the Width column.

If you do it regularly, then use syntax in this way: Save the data as an ASCII file and read it again setting the types of variables as needed. The Text Import Wizard helps you greatly here. An example:

GET FILE='C:\Program Files\SPSS\Mouse survival.sav'. formats all (f5). SAVE TRANSLATE OUTFILE='C:\Program Files\SPSS\Mouse survival.dat' /TYPE=TAB /MAP /REPLACE /FIELDNAMES. GET DATA /TYPE = TXT /FILE = 'C:\Program Files\SPSS\Mouse survival.dat' /DELCASE = LINE /DELIMITERS = "\t" /ARRANGEMENT = DELIMITED /FIRSTCASE = 2 /IMPORTCASE = ALL /VARIABLES = icrf A5 hxm A5 status A5 time A5 hxmd A5 icrfd A5 icrfsq A5 hmxsq A5 icrfhilo A5 . EXECUTE.

Greetings

Jan

-----Original Message----- From: Carol Jones [mailto:jonesce@michigan.gov] Sent: Monday, May 03, 2004 9:19 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: syntax to change numeric to character

I have two hundred and thirty fields in my dataset. I am using ver 12. I need to change all the fields from (F4.0) to (A4) - the field names need to remain the same. Can someone share some syntax to perform this task? Thanks


Back to: Top of message | Previous page | Main SPSSX-L page