27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12 Universals<br />

Data Files<br />

Figure 2 Records from a journal file<br />

DATA LIST /ID 1-3 SEX 4 (A) AGE 5-6 OPINION1 TO OPINION5 7-11.<br />

BEGIN DATA<br />

001F2621221<br />

002M5611122<br />

003F3422212<br />

004F45112L2<br />

>Warning # 1102<br />

>An invalid numeric field has been found. The result has been set to the<br />

>system-missing value.<br />

END DATA.<br />

LIST.<br />

• The warning message, marked by the > symbol, tells you that an invalid numeric field has<br />

been found. Checking the last data line, you will notice that column 10 is L, which is probably<br />

a typographic error. You can correct the typo (for example, by changing the L to 1),<br />

delete the warning message, and submit the file again.<br />

SPSS is capable of reading and writing a wide variety of data file formats, including raw data<br />

files created by a data entry device or a text editor, formatted data files produced by a data<br />

management program, data files generated by other software packages, and SPSS-format<br />

data files.<br />

Raw Data File<br />

Raw data files contain only data, either generated by a programming language, such as<br />

COBOL, FORTRAN, and Assembler, or entered with a data entry device or a text editor.<br />

SPSS can read raw data arranged in almost any format, including raw matrix materials and<br />

nonprintable codes. User-entered data can be embedded within a command file as inline<br />

data or saved on tape or disk as an external file. Nonprintable machine codes are usually<br />

stored in an external file.<br />

Raw data must be defined before they can be used by procedures. Data definition<br />

commands such as DATA LIST, KEYED DATA LIST, and MATRIX DATA can be used to read in<br />

raw data. Appropriate input formats must be specified on these commands (see “Variable<br />

Formats” on p. 25). If for some reason you need to write a raw data file, use the WRITE<br />

command or specify WRITE on a procedure with that subcommand. On most operating<br />

systems, the default extension of a raw data file produced by SPSS is .DAT.<br />

Files from Other Software Applications<br />

You can read files from a variety of other software applications, including dBASE, Lotus,<br />

SYLK, and Excel. You can also read simple tab-delimited spreadsheet files. Use GET<br />

TRANSLATE with different TYPE specifications to read files from common spreadsheet<br />

and database programs. To produce data files for these programs, use SAVE TRANSLATE.<br />

Consult the SPSS Base User’s Guide for your version of SPSS for the types of files (if<br />

any) that your system can read and write.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!