Identifying Observations

You've learned how to remove the Obs column altogether. As another alternative, you can use one or more variables to replace the Obs column in the output.

Using the ID Statement

To specify which variables should replace the Obs column, use the ID statement. This technique is particularly useful when observations are too long to print on one line.
General form, ID statement:
ID variable(s);
where variable(s) specifies one or more variables to print instead of the observation number at the beginning of each row of the report.


To replace the Obs column and identify observations based on an employee's ID number and last name, you can submit the following program.
 proc print data=sales.reps; id ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with O’Reilly online learning.

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