O'Reilly logo

SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required