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 (December 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 16 Dec 2005 09:27:54 -0700
Reply-To:     Adrian Musters <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Adrian Musters <>
Subject:      formats for importing
Content-Type: text/plain; charset=US-ASCII

Hi everyone,

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 by 100?

Here is the syntax I'm using...

GET DATA /TYPE = TXT /FILE = 'R:\prov.txt' /FIXCASE = 1 /ARRANGEMENT = FIXED /FIRSTCASE = 1 /IMPORTCASE = ALL /VARIABLES = /1 ID 0-9 A10 Var1 2615-2621 F5.2 Var2 2622-2628 F5.2. CACHE. EXECUTE.

Thanks in advance, Adrian

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