Date: Fri, 16 Dec 2005 09:27:54 -0700
Reply-To: Adrian Musters <Adrian.Musters@nurs.utah.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Adrian Musters <Adrian.Musters@nurs.utah.edu>
Subject: formats for importing
Content-Type: text/plain; charset=US-ASCII
I have data in a text file which has over 3000 characters per line in a
fixed-width format. I need to import 3 variables in a very specific
way. The ID variable is a string (this works fine) and is imported from
characters 0-9. The variables I'm having trouble with are numeric
variables called Var1 and Var2. In the text file Var1 is found in
characters 2615-2621. If I were to import it using F7.0 I can see that
they are always 4 digits or less (i.e. less than or equal to 9999).
What I would like to do is import the numbers with the decimal place
before the last two digits. I tried to import them using F5.2, but this
truncates everything right of the decimal. For example when I import
566 with F5.2 I was hoping that it would result in 5.66, but instead I
get 5.00. Does anyone know of a way to import these variables so that
I would see 5.66 or 99.99 without having to import them and then divide
Here is the syntax I'm using...
GET DATA /TYPE = TXT
/FILE = 'R:\prov.txt'
/FIXCASE = 1
/ARRANGEMENT = FIXED
/FIRSTCASE = 1
/IMPORTCASE = ALL
/1 ID 0-9 A10
Var1 2615-2621 F5.2
Var2 2622-2628 F5.2.
Thanks in advance,