How to Import a Text Data File Using SPSS Import Statements
Based on SPSS v24
This support document is designed to assist data users with importing text data into SPSS using the NDACAN
provided import statements. This document assumes the data user has already downloaded and saved the data
files from the secure file transfer system to their local computer or institution’s network location (if permitted).
The file containing the import statement will end in .sps. The file containing the text data will end in .dat.
Below, is an example of how the import statement will be organized followed by instructions for which parts of
the syntax you will need to modify.
Example of an import statement from the RPG-2 dataset:
/* The following line should contain the complete path and name of your raw data file */
/* The last line of this file contains the path to your output '.sav' file */
DATA / NAME="c:\temp\DS_218_RPG_2\Data\OAISIS\Text_data\rpg_cbcl.dat" LRECL=37 FILE HANDLE
.
FILE=DATA/DATA LIST
Grantee_ID 1-2 CASE_ID 3-8 (A) IND_ID 9-14 (A)
RPG_TIMEPOINT 15 CBCL_BL_VALID 16 (A) CBCL_EXT_RI 17 (A)
CBCL_INT_RI 18 (A) CBCL_TOT_RI 19 (A)
CBCL_EXTERNAL_NORM 20-21 (A) CBCL_INTERNAL_NORM 22-23 (A)
CBCL_TOTPROB_NORM 24-25 (A) CBCL_WGT 26-37 (A) .
VARIABLE LABELS
Grantee_ID 'GID'
CASE_ID 'Case id number'
IND_ID 'Individual id number'
RPG_TIMEPOINT 'Time period assessment was administered (baseline / followup)'
CBCL_BL_VALID 'Baseline eligibility indicator'
CBCL_EXT_RI 'High risk indicator - external / behavior problems'
CBCL_INT_RI 'High risk indicator - internal / behavior problems'
1