Identifying Observations

Using the ID Statement in PROC PRINT

This statement identifies observations by using the formatted values of the variables that you list instead of by using observation numbers. This statement is particularly useful when observations are too long to print on one line.
Syntax, ID statement in the PRINT procedure:
ID variable(s);
variable(s) specifies one or more variables to print instead of the observation number at the beginning of each row of the report.

Example: ID Statement and VAR Statement

To replace the Obs column and identify observations based on an employee's ID number and last name, submit the following program.
proc print data=sasuser.reps; 
    id idnum lastname; 
run;
This is HTML output from ...

Get SAS Certification Prep Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.