It is usually preferable to use a CLASS statement when running PROC MEANS (or PROC SUMMARY) instead of pre-sorting your data set with a SORT procedure and then using a BY statement.However, if your data set is already sorted in the proper order, and you only need to examine those statistics that you would get when using a CLASS statement and the NWAY option (highest level _TYPE_ groups), a BY statement without a SORT procedure is preferable to CLASS.
A CLASS statement uses more memory than a BY statement, with the amount of memory dependent on the number of CLASS variables as well as the number of levels for each CLASS variable.Running out of memory when using a CLASS statement may necessitate the use of the PROC SORT-BY statement combination.
Assume you have a data set TEST that is not sorted by the variable you wish to use for subgroup analyses,YEAR. Here is the inefficient method of deriving mean values for COST by YEAR.
Example – INEFFICIENTPROC SORT DATA=TEST;
Now here is the preferred method:
Example – EFFICIENTPROC MEANS NOPRINT NWAY DATA=TEST;
SAS Programming Related Tutorials
|SASS (Syntactically Awesome Style sheets) Tutorial||R Programming language Tutorial|
SAS Programming Related Interview Questions
|Logistics Interview Questions||SAS Programming,SQL server Interview Questions|
|Clinical SAS Interview Questions||SASS (Syntactically Awesome Style sheets) Interview Questions|
|SQL Server Analysis Services (SSAS) Interview Questions||R Programming language Interview Questions|
|SAS DI Interview Questions||Advanced SAS Interview Questions|
|Base Sas Interview Questions||SAS Macro Interview Questions|
|Clinical Data Management Interview Questions|
Sas Programming Tutorial
Input And Infile
Set, Merge, And Update
Table Lookup Tools
Proc Means And Proc Uimivariate
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.