The correct answer is C. To create the NODONATIONS dataset, which includes only the employees
who did not make any donations, a merge operation is used with a conditional statement to filter out
those records. The syntax if inE=1 and inD=0; ensures that the merged dataset includes only the
observations from the EMPLOYEES dataset that do not have a corresponding observation in the
DONATIONS dataset. This is achieved using data step processing with the in= option to create
temporary variables that indicate whether the data is coming from the input dataset.
In the other options:
A is incorrect because inE=0 and inD=0 will never be true after a merge since at least one of the
datasets must contribute to the merged observation.
B lacks the necessary conditional logic to filter out employees with donations.
D is incorrect because if inE=1 and inD=1; would actually select employees who made donations, the
opposite of what we want.
Reference:
SAS documentation on merging data sets using the DATA step.