The data used comes from the internal SASHELP library, specifically the `sashelp.class` and `sashelp.cars` datasets.
1 Code Block
PROC PRINT
Explanation : Displays the entire `sashelp.class` dataset, listing all columns and all observations by default. Useful for an initial overview of the data.
Copied!
proc print data=sashelp.class;
run;
1
PROC PRINTDATA=sashelp.class;
2
RUN;
2 Code Block
PROC PRINT
Explanation : Displays the first 10 observations (rows) of the `sashelp.class` dataset, using the `obs=10` option to limit the output. This provides a quick overview without displaying all data.
Copied!
proc print data=sashelp.class (obs=10);
run;
1
PROC PRINTDATA=sashelp.class (obs=10);
2
RUN;
3 Code Block
PROC PRINT
Explanation : Displays the first 10 observations of the `sashelp.cars` dataset, but limits the displayed columns to the 'Make', 'Model', 'Type', and 'MSRP' variables specified in the `VAR` statement.
Copied!
proc print data=sashelp.cars (obs=10);
var make model type msrp;
run;
1
2
PROC PRINT
3
DATA=sashelp.cars (obs=10);
4
var make model type msrp;
5
RUN;
6
4 Code Block
PROC MEANS
Explanation : Calculates summary descriptive statistics (by default: N, mean, standard deviation, min, max) for the numeric variables 'enginesize', 'horsepower', 'mpg_city', and 'mpg_highway' from the `sashelp.cars` dataset. Allows for quick identification of central tendencies and value ranges.
Copied!
proc means data=sashelp.cars;
var enginesize horsepower mpg_city mpg_highway;
run;
1
2
PROC MEANS
3
DATA=sashelp.cars;
4
var enginesize horsepower mpg_city mpg_highway;
5
RUN;
6
5 Code Block
PROC UNIVARIATE
Explanation : Generates more detailed descriptive statistics for the numeric variable 'mpg_highway' from the `sashelp.cars` dataset. This includes quantiles, normality tests, moments, information on extreme values, and graphs (if outputted).
Copied!
proc univariate data=sashelp.cars;
var mpg_highway;
run;
1
2
PROC UNIVARIATE
3
DATA=sashelp.cars;
4
var mpg_highway;
5
RUN;
6
6 Code Block
PROC FREQ
Explanation : Creates frequency tables for the categorical variables 'origin', 'type', and 'drivetrain' from the `sashelp.cars` dataset. Each table presents distinct values, their frequency, their percentage, and their cumulative frequencies/percentages. Very useful for data validation and anomaly detection.
Copied!
proc freq data=sashelp.cars;
tables origin type drivetrain;
run;
1
2
PROC FREQ
3
DATA=sashelp.cars;
4
tables origin type drivetrain;
5
RUN;
6
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.