Thread View: bit.listserv.spssx-l
2 messages
2 total messages
Started by Felicia A. Ferko
Mon, 26 Jul 1993 17:05
writing out ascii files
Author: Felicia A. Ferko
Date: Mon, 26 Jul 1993 17:05
Date: Mon, 26 Jul 1993 17:05
9 lines
1106 bytes
1106 bytes
I have an SPSS-s system file, and I want to convert it to a comma-delimited ascii file (free format), with missing values replaced by "-9." Can someone please help identify commands that will easily accomplish this task? Thank you, Felicia Ferko
Re: writing out ascii files
Author: Jerry Dallal
Date: Tue, 27 Jul 1993 15:13
Date: Tue, 27 Jul 1993 15:13
55 lines
3187 bytes
3187 bytes
In article <UgJ0vba00iV0I4_X8h@andrew.cmu.edu>, "Felicia A. Ferko" <ff12+@ANDREW.CMU.EDU> writes: > I have an SPSS-s system file, and I want to convert it to a > comma-delimited ascii file (free format), with missing values replaced > by "-9." > > Can someone please help identify commands that will easily accomplish > this task? > This code will give you a space delimited rather than comma delimited file. I believe you can put "," between the variable names in line 13 to get a comma delimited file. 1 SET WIDTH=80 / LENGTH = 59 2 3 FILE HANDLE F1/NAME=<filename> 4 GET FILE=F1 5 6 DO REPEAT X = <variable list> 7 8 IF (MISSING(X)) X = -9 9 END REPEAT 10 11 FILE HANDLE F2/NAME=<filename> 12 PRINT OUTFILE=F2/ 13 <variable list> 14 15 16 EXECUTE 17 18 FINISH Line 1 causes the printed output to be 59 lines by 80 columns. The WIDTH specification also applies to the data file but the LENGTH specification does not. Lines 3 and 4 specify the SPSS-X system file. Lines 6 through 9 insure that missing values are handled properly. SPSS-X allows users to specify values that represent missing data. Unless proper care is taken, these values will be listed in the the ASCII data file without any indication of their special status. Line 8 causes these user specified missing values to appear in the data file as -9. This happens for every variable listed to the right of the equals sign. Line 11 specifies the name of the ASCII data file. Lines 12 and 13 specify the variables to be included in the ASCII file. It is good a practice to use the editor's cut-and-paste feature to copy the variable list from line 6 to line 13 to insure that errors are not introduced while retyping the variable list. SPSS-X uses the system file dictionary to determine how many decimal places to print in the output file. This value can be overridden by using the PRINT FORMATS statement or as part of the PRINT command itself. See the SPSS-X manual for details.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads