The code above is just an extension of the basic SET statement, but instead of having one dataset listed after the SET keyword, there are two or more datasets listed. SET Dataset-Name-1 (OPTIONS) Dataset-Name-2 (OPTIONS) When you have two or more datasets with the same structure, then you can combine them using the SET statement within a data step: DATA New-Dataset-Name (OPTIONS) You may want to combine these records into a single dataset by "appending" one dataset to the bottom of the other. This may happen if you have to researchers collecting observations at different locations or times. Suppose you have two or more datasets with the same structure (i.e., completely identical variables) but different cases (i.e., the rows in each dataset are unrelated to one another). For example, you may have demographic information about customers in one dataset, and transaction information in a second dataset both datasets will have a "customer ID" variable that uniquely identifies who made the purchase, but the variables in each dataset will be different. Merging is useful when you have relevant information stored in separate data sources. This can happen if you have datasets covering different time periods, and want to analyze trends over time: in order to do so, you'll need to put all of the time periods into a single dataset for analysis.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |