To prepare a flat file for analysis, you must first create an incident-level aggregated flat file and then break it into segments (offense, property, victim, offender and arrestee). The sections below discuss these two steps and present the syntax necessary for completing them. With the available code, a flat file is made by creating the necessary variables and then breaking out the individual segments.

Please note that the steps are presented separately for SPSS after each step; the SAS code is presented together after the second step. The SPSS files complete the steps in the order listed below. However, the SAS code does these steps a little differently by preparing each segment individually.


The purpose of creating an incident-level aggregated flat file is to reduce the size of the file and to examine NIBRS data at an incident unit of analysis. The creation of new variables is driven by the anticipated reporting and research requirements. Variables can be created to produce summary counts comparable to those produced by the UCR, but with substantially more information. One can count the number of incidents and also obtain a count of the number of offenses, victims, offenders, and arrestees involved in the incidents. By creating additional variables, one can count, for example, the number of incidents in which the victim is an individual, in which the offenders are aged 10-17, or for which rape is one of the offenses in multiple offense incidents.

New variables are created and assigned values for the purpose of counting occurrences. These new variables are appended to the existing flat file (see Reading A Multi-Level File). The data are restructured so that the occurrences of a variable are counted for each unique incident (ORI + incident number). Counting at the incident level is fundamental to understanding the data and building cross-tabulation tables.


Incident-based reporting systems in relational databases most likely will not require further preparation for analysis using relational software. In relational databases, the individual data segments are stored in separate tables. However, analysis using SPSS or SAS will require further data segment preparation. The data segments chosen depend upon the research question(s) and unit(s) of analysis required for answering the question(s). This preparation involves first extracting the data segment(s) and data segment records and then storing each segment with its related records in a file. For example, the victim data segment records are extracted and stored in a separate victim data file and the offense segment records are extracted and stored in an offense data file. This preparation allows for efficient detailed analysis of a single segment or, by a merging of multiple segments, detailed analysis across segments.


The final data files are composed of 139 variables among the seven segment files. For more information on these variables, view the List of Data Elements.

Download the full SPSS syntax file for BOTH steps
Download the full SAS syntax file for BOTH steps
Please note that due to SAS restrictions, the SAS syntax file HAS NOT been tested. If you experience any difficulties using this file, please contact us.

For a refresher on the NIBRS data structure, please review the MultiLevel Data File Section.

Now you are ready to view Tips and Shortcuts for Working with NIBRS Data.