Skip to Main Content

Reading raw data files over 1024 columns wide | SPSS Code Fragments

Say we try to read a raw data file with DATA LIST that is over 1024
columns wide as shown in the example below.  

DATA LIST      FILE="small" FIXED /
               id 1 age 2-3 
               <some program omitted to save space>
               HISP 4925-4925 HOMEOWN3 4926-4926 HSDIV 4927-4927 HSREG 4928-4928
               EDATTAiN 4929-4930 FAMFOR86 4931-4932.

SPSS will give us the following error, indicating that it is reading only up
to column 1024 (even though our data file in this example has 4932 columns).

>Warning # 1100
>A data element conversion on the indicated command will go past the end of
>the record.  Check the data list and the data file.  The result has been
>set to the system-missing value.
>Command line: 2  Current case: 1  Current splitfile group: 1
>Record number: 1  Starting column: 1026  Record length: 1024

To tell SPSS that the raw data file is 4932 columns wide, we need to use the file
handle
statement like shown below.


file handle test /name="small" /recform=fixed /lrecl=4932.
DATA LIST      FILE=test FIXED /
               id 1 age 2-3 
               <some program omitted to save space>
               HISP 4925-4925 HOMEOWN3 4926-4926 HSDIV 4927-4927 HSREG 4928-4928
               EDATTAiN 4929-4930 FAMFOR86 4931-4932.