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.

Example

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.