The script sets a dynamic title using the `&gender` macro variable. It then executes a `PRINT` procedure on the `sashelp.class` dataset, applying a `WHERE` filter to select only records where the `sex` column matches the value of `&gender`.
Data Analysis
Type : SASHELP
Uses the standard SASHELP.CLASS example dataset.
1 Code Block
PROC PRINT
Explanation : Displays filtered data with a dynamic title. The WHERE clause restricts results based on the &gender macro variable's value.
Copied!
Title "Display class data for &gender";
proc print data=sashelp.class;
where sex="&gender";
run;
1
Title "Display class data for &gender";
2
PROC PRINTDATA=sashelp.class;
3
where sex="&gender";
4
RUN;
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.