| Variable Names |
Only the short variable name style is supported.
SPSS variable names can be up to eight characters in length. All alphabetic
characters must be uppercase. The first character in a variable name can be
an uppercase letter (A-Z), a dollar sign ($), or an "at" sign (@). Subsequent
characters can be any of these characters, plus numerals (0-9), periods (.),
number signs (#), or underscores ( _ ).
SPSS reserves 13 words, which are not allowed to stand alone as variable
names: ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, and WITH. If the
program encounters any of these as a variable name, it appends an underscore
to the variable name to distinguish it from the reserved word (for example, ALL
becomes ALL_
).
Invalid characters are converted to underscores unless they are encountered
as the first character in a variable name. In that event, the "at" sign (@)
is used instead (for example, %ALL
becomes @ALL
).
When you are exporting to SPSS, SAS variable names that are longer than
eight characters are truncated to eight characters. If the truncation results
in the same name as another variable, the last character is changed to a single
digit (1, 2, 3, and so on) until the variable name becomes unique. |
| Data Types |
SPSS supports numeric and character field types that
map directly to SAS numeric and character fields. The following list shows
other SPSS data types and how PROC IMPORT converts them to SAS formats.
| Date, Jdate, Wkday, Qyr, Wkyr |
Date, Jdate, Wkday, Qyr, Wkyr |
| Datetime, Dtime |
Converts to a SAS datetime value and SAS datetime
format. |
| Time |
Converts to a SAS datetime value and SAS datetime
format. |
| Adate |
Converts to a SAS date value in the mmddyy format. |
| Moyr |
Converts to a SAS date value in the mmmyy format. |
When writing SAS data to an SPSS file, PROC EXPORT converts data into
SPSS variable types.
When exporting data, character fields have a maximum length of 256.
Numeric fields are 8-byte floating-point numbers, with the following
format conversions:
| Comma |
Converts to SPSS format type comma. |
| Dollar |
Converts to SPSS format type dollar. |
| Date |
Converts to SPSS format type date. |
| mmddyy |
Converts to SPSS format Adate. |
| mmmyy |
Converts to SPSS format Moyr. |
| Datetime |
Converts to SPSS format Dtime. |
| Time |
Converts to SPSS format Time. |
|