DATA LIST
DATA LIST defines a text data file by assigning names and formats to each variable in the file. Text data can be inline (entered with your commands between BEGIN DATA and END DATA) or stored in an external file. They can be in fixed format (values for the same variable are always entered in the same location on the same record for each case) or in freefield format (values for consecutive variables are not in particular columns but are entered one after the other, separated by a specified delimiter).
DATA LIST [FILE='file'] [ENCODING='encoding specification']
[{FIXED**}]
{FREE } [{("delimiter", "delimiter",..., TAB)}]
{LIST }
[RECORDS={1**}] [SKIP={n}] [{TABLE**}]
{n } {NOTABLE}
/{1** } varname {col location [(format)]} [varname ...]
{rec #} {(FORTRAN-like format) }
[/{2** } ...] [/ ...]
{rec #}
Type | Column-style format | FORTRAN-like format |
---|---|---|
Numeric (default) | d or F,d | Fw.d |
Restricted numeric | N,d | Nw.d |
Scientific notation | E,d | Ew.d |
Numeric with commas | COMMA,d | COMMAw.d |
Numeric with dots | DOT,d | DOTw.d |
Numeric with commas and dollar sign | DOLLAR,d | DOLLARw.d |
Numeric with percent sign | PCT,d | PCTw.d |
Zoned decimal | Z,d | Zw.d |
String | A | Aw |
Type | Column-style format | FORTRAN-like format |
---|---|---|
Tab to column n | Tn | |
Skip n columns | nX |
Type | Data input | Format | FORTRAN-like format |
---|---|---|---|
International date | dd-mmm-yyyy | DATE | DATEw |
American date | mm/dd/yyyy | ADATE | ADATEw |
European date | dd/mm/yy | EDATE | EDATEw |
Julian date | yyddd | JDATE | JDATEw |
Sorted date | yy/mm/dd | SDATE | SDATEw |
Quarter and year | qQyyyy | QYR | QYRw |
Month and year | mm/yyyy | MOYR | MOYRw |
Week and year | wkWKyyyy | WKYR | WKYRw |
Date and time | dd-mmm-yyyy hh:mm:ss.ss | DATETIME | DATETIMEw.d |
Time | hh:mm:ss.ss | TIME | TIMEw.d |
Days and time | ddd hh:mm:ss.ss | DTIME | DTIMEw.d |
Day of the week | string | WKDAY | WKDAYw |
Month | string | MONTH | MONTHw |
Note: For default numeric (F) format and scientific notation (E) format, the decimal indicator of the input data must match the IBM® SPSS® Statistics locale decimal indicator (period or comma). Use SHOW DECIMAL to display the current decimal indicator and SET DECIMAL to set the decimal indicator. (Comma and Dollar formats only recognize a period as the decimal indicator, and Dot format only recognizes the comma as the decimal indicator.)
Release History
Release 16.0
- ENCODING subcommand added for Unicode support.
Example
DATA LIST /ID 1-3 SEX 5 (A) AGE 7-8 OPINION1 TO OPINION5 10-14.