
Chapter 10
By-Group Processing in SAS
Programs
Definition of BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
References for BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Definition of BY-Group Processing
BY-group processing is a method of processing observations from one or more data sets
so that the observations are grouped by common variable values. You can use BY-group
processing in both DATA and PROC steps.
The most common use of DATA step BY-group processing is to combine multiple SAS
data sets and use the BY statement with one of the following language elements:
• SET statement
• MERGE statement
• MODIFY statement
• UPDATE statement
When you create reports or summaries with SAS procedures, BY-group processing
enables you to group information in the output according to values of one or more
variables.
References for BY-Group Processing
• For more information about BY-Group processing, see Chapter 22, “BY-Group
Processing in the DATA Step,” on page 459.
• For information about how to use BY-group processing with SAS procedures, see
“Fundamental Concepts for Using Base SAS Procedures” in Base SAS Procedures
Guide and individual procedures in Base SAS Procedures Guide.
• For information about using BY-group processing to combine information from
multiple SAS data sets, see Chapter 23, “Reading, Combining, and Modifying SAS
Data Sets,” on page 475. For even more extensive examples of BY-group processing,
see Combining and Modifying SAS Data Sets: Examples.
175
Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.