19 data emplsal;
20 merge employee (in=ine) salary(in=ins);
21 by name;
22 if ine and ins;
NOTE: There were 2 observations read from the data set WORK.EMPLOYEE.
NOTE: There were 4 observations read from the data set WORK.SALARY.
NOTE: The data set WORK.EMPLSAL has 4 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
The statement merge employee (in=ine) salary(in=ins); performs a match merge based on the BY variable name. The additional statement if ine and ins; will allow SAS to write values in output dataset when both datasets contribute to the match merge (i.e. values come from both datasets).
Here we have two observations in the SALARY dataset for variable fname value 'Bruce' so in the output dataset we have two records. Similarly, for variable fname value 'Dan' we have two observations in the SALARY dataset so in the output dataset we have two records. A total of four records will be output so option A is correct.
The one and only FREE resource for general SAS online training as well as study guides for the SAS Base Certification. My goal is to create the SAS Certification prep guide that I never found but always wanted. This should also be a place to come if you are new to the language but are simply looking for online SAS training.