ARCHIVED: In SPSS, how do I generate an ID variable that consecutively numbers each case in my data?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

In SPSS, to generate an ID variable to consecutively number each case in your data, use the following command, which creates a variable called id and adds an ID number under the ID variable:

  COMPUTE id=$CASENUM.
  FORMAT id (F8.0).
  EXECUTE.

If you have questions about using statistical and mathematical software at Indiana University, contact the UITS Research Applications and Deep Learning team.

This is document aqhw in the Knowledge Base.
Last modified on 2023-05-09 14:39:29.