Consider the data sets names and values in the tables below Values Obe IdName 1
ID: 3323434 • Letter: C
Question
Consider the data sets names and values in the tables below Values Obe IdName 1 ATL Brae 2MA Marin NYM Mets 1 ATL11 2 MA 31 31 30 32 NYM 5 WAS National s WAS 2 Merged Result Obs ld NameWins Atempts Winning Percentage 1 ATL Braves 11 2MA Marlins 1 3 NYM Mets15 PH Philies 13 5 WAS National 21 31 31 30 32 66% The goal is to combine the data sets NAMES and VALUES to create the data set MERGED RESULT using the common id variable and to create a variable percent by dividing wins by attempts, use an appropriate format to display the value with a percent sign and label the variable as Winning Percentage as shown. Note: the Obs column comes from the print procedure and need not be part of your solution.Explanation / Answer
proc sql;
create table MergedResult as
select a.*,
b.wins,
b.attempts,
b.wins/b.attempts as WinningPercentage format percent10.0 label = 'Winning Percentage'
from names a
left join values b
on a.id = b.id;
quit;