MailLib Concept - Exercise #12

Data

data one;
    subject=1; test='A'; x=1; output;
    subject=1; test='B'; x=2; output;
    subject=1; test='C'; x=3; output;
    subject=2; test='A'; x=1; output;
run; 
data two;
    subject=1; y=100; output;
    subject=2; y=200; output;
run; 
Dataset one Dataset two

Program

data demo;
    merge one two;
    by subject;
    if test='B' then y=999;
run; 
Dataset one Dataset two Dataset demo

The datasets one and two are merged by subject. The value of y is then updated when test='B'. But When test='C', the value of y does not remain 100; It is also modified.

Task

Update the program to get the following result:

Dataset one Dataset two Dataset demo (Updated)

SOLUTION TOMORROW

Copyright © 2024 xxformat GmbH, All Rights Reserved

xxformat GmbH

c/o STARTPLATZ, Im Mediapark 5
50670 Cologne
Germany

Amtsgericht Köln HRB 90276

Geschäftsführer: Véronique Bourcier
veronique.bourcier@xxformat.com
+49 1577 288 6066