Size: 1522
Comment:
|
Size: 2603
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 14: | Line 14: |
Numeric data is stored as double-precision floating point. | '''Numeric''' data is stored as double-precision floating point. |
Line 26: | Line 26: |
See [[SPSS/NumericFunctions|here]] for the built-in library of numeric functions. |
|
Line 30: | Line 32: |
'''Date''' data is stored as the number of seconds from midnight, October 14, 1582 to midnight on the specified date. '''Datetime''' data is stored as the number of seconds to the specified time on the specified date. '''Time''' data is stored as the number of seconds. This ''can'' be imagined as the number of seconds from midnight to the specified time, but that is not a ''necessary'' construct. Keep in mind that 1 day = 60 (seconds) * 60 (minutes) * 24 (hours) = 86400 seconds. |
|
Line 31: | Line 41: |
||DATETIME20 ||`dd-MMM-yyyy hh:mm:ss` || ||DATETIME17 ||`dd-MMM-yyyy hh:mm` || ||DATE11 ||`dd-MMM-yyyy` || ||DATE9 ||`dd-MMM-yy` || ||TIME8 ||`hh:mm:ss` || ||TIME5 ||`hh:mm` || ||ADATE10 ||`mm/dd/yyyy` || |
||`DATETIME20` ||`dd-MMM-yyyy hh:mm:ss` || ||`DATETIME17` ||`dd-MMM-yyyy hh:mm` || ||`DATE11` ||`dd-MMM-yyyy` || ||`DATE9` ||`dd-MMM-yy` || ||`TIME8` ||`hh:mm:ss` || ||`TIME5` ||`hh:mm` || ||`ADATE10` ||`mm/dd/yyyy` || ||`EDATE10` ||`dd.mm.yyyy` || ||`SDATE10` ||`yyyy/mm/dd` || |
Line 40: | Line 52: |
Note that `DATE11` and `DATE9` differ in the representation of years ''(4 and 2 digits respectively)''. The American, European, and Sortable date formats have a similar feature by swapping `[AES]DATE10` with `[AES]DATE8`. See [[SPSS/DateTimeFunctions|here]] for the built-in library of date and time functions. |
|
Line 47: | Line 63: |
String data is stored at a fixed length. This length is defined and adjusted through the format; `Aw` where `w` is the width. | '''String''' data is stored at a fixed length. This length is defined and adjusted through the format; `Aw` where `w` is the width. See [[SPSS/StringFunctions|here]] for the built-in library of string functions. |
SPSS Data Types
SPSS exposes numeric and string data types.
Certain specialized forms of data are handled by formats that impact visualization and export, not storage. The primary example of this is date and time data.
Numeric Data
Numeric data is stored as double-precision floating point.
Data formats adjust the visualized/exported representation of a data point, often only truncating the value. Adjusting these data formats does not destroy precision.
Given the literal value 123.45...
General Format |
Format |
Representation |
Fw |
F8 |
123 |
Fw.d |
F8.1 |
123.4 |
Nw |
N8 |
00000123 |
Nw.d |
N8.1 |
000123.4 |
See here for the built-in library of numeric functions.
Date and Time Formats
Date data is stored as the number of seconds from midnight, October 14, 1582 to midnight on the specified date.
Datetime data is stored as the number of seconds to the specified time on the specified date.
Time data is stored as the number of seconds. This can be imagined as the number of seconds from midnight to the specified time, but that is not a necessary construct.
Keep in mind that 1 day = 60 (seconds) * 60 (minutes) * 24 (hours) = 86400 seconds.
Format |
Representation |
DATETIME20 |
dd-MMM-yyyy hh:mm:ss |
DATETIME17 |
dd-MMM-yyyy hh:mm |
DATE11 |
dd-MMM-yyyy |
DATE9 |
dd-MMM-yy |
TIME8 |
hh:mm:ss |
TIME5 |
hh:mm |
ADATE10 |
mm/dd/yyyy |
EDATE10 |
dd.mm.yyyy |
SDATE10 |
yyyy/mm/dd |
Note that MMM appears as JAN, not 001.
Note that DATE11 and DATE9 differ in the representation of years (4 and 2 digits respectively). The American, European, and Sortable date formats have a similar feature by swapping [AES]DATE10 with [AES]DATE8.
See here for the built-in library of date and time functions.
String Data
String data is stored at a fixed length. This length is defined and adjusted through the format; Aw where w is the width.
See here for the built-in library of string functions.