93.6k views
3 votes
Which statement is true concerning match-merging?

a. The MERGE statement must refer to permanent data sets.
b. The variables in the BY statement can be in only one of the data sets.
c. Only two data sets can be specified in the MERGE statement.
d. When you use the MERGE statement with the BY statement, the data must be sorted or indexed on the BY variable

User Legendmohe
by
7.5k points

1 Answer

1 vote

Final answer:

The correct statement about match-merging is that when using the MERGE statement with a BY statement, the data must be sorted or indexed on the BY variable.

Step-by-step explanation:

Regarding match-merging in data processing, let's address each statement provided:

  • a. The MERGE statement must refer to permanent data sets. - This is not necessarily true, as the MERGE statement can work with temporary data sets as well as permanent ones.
  • b. The variables in the BY statement can be in only one of the data sets. - This is incorrect; the variables specified in the BY statement must be present in all the data sets being merged to serve as a key for the merging process.
  • c. Only two data sets can be specified in the MERGE statement. - This is also not true; SAS allows for multiple data sets to be merged in a single MERGE statement.
  • d. When you use the MERGE statement with the BY statement, the data must be sorted or indexed on the BY variable - This is the correct statement. For a successful match-merge, the data in each dataset must be sorted or indexed by the variables specified in the BY statement.

The correct answer is d. When performing a match-merge, the datasets to be merged should be sorted or indexed on the BY variables to correctly align the data rows based on the keys defined by these variables.

User Adam Gardner
by
7.7k points