4. Value of all the common columns for which course_id matches will be unpredictable.
Correct Answer : Get Lastest Questions and Answer : Explanation: In case of merge if id matches than all the columns which are common will be overwritten by the second dataset.
Question : You have been given below dataset and program
data course100; merge course101 (in=in_first rename=(DATE=TRAINING_DATE)) course102 (in=in_second rename=(DATE=REGISTRATION_DATE)) ; by COURSE_ID; if in_first=1 and in_second=1; run;
Correct Answer : Get Lastest Questions and Answer : Explanation: When you use the IN= option with the merge operation, it will help you to find whether match exists in both the dataset or not. You can use if condition to have only matched dataset in the output. So in this case option 2 is correct which only print matching dataset present in both the dataset. Also column will be re-named.
Question : You have two datasets Course and Course both have the Fee column variables. However, you dont want that Fee column from first dataset will be overwritten during match merge. How can you avoid that, select the correct SAS program?
1. data course100; merge course101 (in=FirstFee) course102 ; by COURSE_ID; if in_first=1 and in_second=1; run;
2. data course100; merge course101 (rename=(FEE=TRAINING_FEE)) course102 (rename=(FEE=REGISTRATION_FEE)) ; by COURSE_ID; run;
Correct Answer : Get Lastest Questions and Answer : Explanation: When you use match merging and column with the same name is found in second data set . Than second dataset will overwrite the first dataset column in output. To solve this issue, you can use rename= option which will re-name the column name. And you can do it with only one of the dataset column name or both with separate name.