Understanding the Tools for Combining SAS Data Sets

Once you understand the basics of establishing relationships among data and the ways you can combine SAS data sets, you can choose from a variety of SAS tools for accessing, combining, and processing your data. Table 1.1 lists and briefly describes the primary tools that are featured in this book. The remainder of the section describes in more detail some of the choices to make in determining how to combine and modify your data sets.

Table 1.1. Tools for Combining SAS Data Sets
Class of ToolStatement, PROC, or Other ToolAction PerformedSequentialDirectCan Use with BY StatementComments
DATA Step StatementsSETReads an observation from one or more SAS data sets.XXXUse KEY = or POINT= to access data directly.
MERGEReads observations from two or more SAS data sets and joins them into single observations.X XWhen using MERGE with BY, the data must be sorted or indexed on the BY variable.
MODIFYManipulates observations in a SAS data set in placeXXXSorted and indexed data are not required for direct access or usage with BY, but are recommended for performance.
UPDATEApplies transactions to observations in a master SAS data set. UPDATE does not update observations in place; it produces an updated copy of the current data set.X XBoth the master and transaction data sets must be sorted or indexed on the BY variable.
BYControls the operation of a SET, MERGE, UPDATE, or MODIFY statement in the DATA step and sets up special grouping variables.N/AN/AN/ABY-group processing is a means of processing observations that have the same values of one or more variables.
PROCsPROC APPENDAdds the observations from one SAS data set to the end of another SAS data set.X  This procedure is limited to appending one data set to another.
PROC DATASETS with APPEND StatementAdds the observations from one SAS data set to the end of another SAS data set.X  The APPEND statement in this procedure is limited to appending one data set to another.
PROC SQLJoins rows from one or more tables and can manipulate the rows in a table in place. The maximum number of tables that PROC SQL can read is 256.XX The access method is chosen by the PROC SQL internal optimizer.
OtherDATA Step Hash ObjectsEnables you to quickly and efficiently store, search, and retrieve data based on lookup keys. Consists of two predefined component objects for use in the DATA step: the hash object and the hash iterator object.N/AN/AN/AComponent objects are data elements that consist of attributes and methods. Attributes are the properties that specify the information that is associated with an object. Methods define the operations that an object can perform.
_IORC_An automatic variable that is created when you use the MODIFY statement or when you use the SET statement with the KEY=option.N/AN/AN/AThe value of this variable is a numeric return code that indicates the status of the most recent I/O operation that used MODIFY or KEY=.
%SYSRCAn autocall macro program that you use in conjunction with _IORC_ to test for specific I/O conditions.N/AN/AN/A

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.212.104