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!
title "Listing of SASHELP.CLASS";
proc print data=sashelp.class noobs;
where Age > 13; /*1*/
format Height Weight 3.0 /*2*/
Name $upcase8.;
run;
title;
1
title "Listing of SASHELP.CLASS";
2
PROC PRINTDATA=sashelp.class noobs;
3
where Age > 13; /*1*/
4
FORMAT Height Weight 3.0/*2*/
5
Name $upcase8.;
6
RUN;
7
title;
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.