BY-Group Processing in the DATA Step |
Before you process one or more SAS data sets using grouped or ordered data with the SET, MERGE, or UPDATE statements, you must check the data to determine whether they require preprocessing. They require no preprocessing if the observations in all of the data sets occur in one of the following patterns:
not alphabetically or numerically ordered, but grouped in some way, such as by calendar month or by a formatted value
If the observations are not in the order that you want, you must either sort the data set or create an index for it before using BY-group processing.
If you use the MODIFY statement in BY-group processing, you do not need to presort the input data. Presorting, however, can make processing more efficient and less costly.
You can use PROC SQL views in BY-group processing. For complete information, see SAS 9.2 SQL Procedure User's Guide.
SAS/ACCESS Users: If you use SAS views or librefs, refer to the SAS/ACCESS documentation for your operating environment for information about using BY groups in your SAS programs.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.