UCLA Academic Technology Services HomeServicesClassesContactJobs
Help the Stat Consulting Group by giving a gift             
Loading

SPSS Code Fragments
Reading raw data files over 1024 columns wide

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.

How to cite this page

Report an error on this page or leave a comment

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California