If all the data is there just the wrong format just use ALTER TYPE and change it.
Original Message:
Sent: Wed October 18, 2023 01:44 PM
From: Caralin Branscum
Subject: Trouble Importing from Excel to SPSS - Reading a String as Numeric and not Importing Correctly
Thank you for the reply! I'm a little confused though. The document is already a CSV and I need the variable to read as a String but it is being read as a numeric variable, but I'm not sure how to change this.
------------------------------
Caralin Branscum
Original Message:
Sent: Wed October 18, 2023 01:00 PM
From: Art Jack
Subject: Trouble Importing from Excel to SPSS - Reading a String as Numeric and not Importing Correctly
You can save it as a csv and choose numeric on the import for the key.
------------------------------
Art Jack
Original Message:
Sent: Tue October 17, 2023 07:58 PM
From: Caralin Branscum
Subject: Trouble Importing from Excel to SPSS - Reading a String as Numeric and not Importing Correctly
I cannot seem to get my Excel file to Import into SPSS correctly for the Unique Identifier variable because the Unique Identifier variable has three different types of styles: (1) numeric numbers, (2) mix of numbers and letters, and (3) numbers so long excel automatically converted it into scientific notation (excel file attached). SPSS assumes I'm trying to import the Unique identifier as a numeric variable, so exactly 510 rows are imported with BLANKS in the unique identifier variable. I tried converting the scientific notation into their full numeric values but SPSS still reads the variable as a numeric variable and I can't get it to change.
My question is: How can I get SPSS to read this variable as a String so it doesn't delete any of the unique identifiers? The unique identifiers cannot change or be replaced (other than removing scientific notation) as they are important for merging with other data files.
This is the standard import syntax I've used thus far:
NEW FILE.
DATASET NAME DataSet1 WINDOW=FRONT.
GET DATA
/TYPE=XLSX
/FILE='C:\Users\Me\OneDrive - University of Nebraska at Omaha\UNO Research\2. GRACA\Branscum_2023 GRACA-K-12 SBH\Data Cleaning\Example Data.xlsx'
/SHEET=name 'Study variables'
/CELLRANGE=FULL
/READNAMES=ON
/DATATYPEMIN PERCENTAGE=95.0
/HIDDEN IGNORE=YES.
EXECUTE.
DATASET NAME DataSet2 WINDOW=FRONT.
SORT CASES BY UniqueIdentifier (A).
------------------------------
Caralin Branscum
------------------------------