Published on :
Reporting SASHELP

Formatted Display of the SASHELP.CLASS Table

This code is also available in: Deutsch Español Français
This script selects records from the SASHELP.CLASS table where age is greater than 13. It uses the PRINT procedure to display results, applying specific formats: rounding height and weight to integers, and capitalizing names. The NOOBS option is used to hide observation numbers.
Data Analysis

Type : SASHELP


Uses the standard SASHELP.CLASS table provided with SAS installation.

1 Code Block
PROC PRINT
Explanation :
Executes a PRINT procedure (PROC PRINT) on the 'sashelp.class' table. Filters data to only keep ages > 13. Applies a numeric format 3.0 (rounded without decimals) to 'Height' and 'Weight' variables, and an uppercase format ($upcase8.) to the 'Name' variable. The 'noobs' option removes the observation number column.
Copied!
1title "Listing of SASHELP.CLASS";
2PROC PRINT DATA=sashelp.class noobs;
3 where Age > 13; /*1*/
4 FORMAT Height Weight 3.0 /*2*/
5 Name $upcase8.;
6RUN;
7title;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.