Multiple choice technology programming languages

There are 2 datasets sales and income.Sales has a variable pno and income has a variable product.Both are same.The third dataset has to be formed by merging sales and income that has the same products.Which is the correct option?

  1. data new;set income(in=IN_A rename=( product = pno)) sales(in=in_b); if IN_A and IN_B;run;

  2. data new;merge income(in=IN_A) (rename( product = pno)) sales(in=IN_B);run;

  3. data new;merge income(in=IN_A) (rename=( product = pno)) sales(in=IN_B);if IN_A and IN_B;run;

  4. data new;merge income(in=IN_A rename=( product = pno)) sales(in=in_b); if IN_A and IN_B;run;

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Option D correctly renames the variable within the merge statement: 'merge income(in=IN_A rename=(product = pno)) sales(in=in_b);'. The RENAME option must be in parentheses immediately after the dataset it applies to. Option A uses SET instead of MERGE. Options B and C incorrectly enclose RENAME in separate parentheses, which is invalid syntax. The IN variables filter for matching records.