DATA Step, Macro, Functions and more

merge

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

merge

Untitled.png

Untitled.png

How many observations are in data set WORK.ALL after submitting the program?

 

Why is the answer 2 and not 3? I thought the only observation omitted is the empid=1864 and empid=3567? Please help, thanks!!!!


Accepted Solutions
Solution
‎09-28-2017 10:16 PM
Super User
Posts: 6,629

Re: merge

I think you're looking at this as if the program read:

 

if Emp_D and Emp_N;

 

That statement would select the matches (and there are 3 of those).  However, the IF statement is different.  It is designed to select the mismatches (and there are 2 of those).

View solution in original post


All Replies
Super User
Posts: 9,886

Re: merge

Look again. 5463 is also present in both datasets. Only 1864 (Jill) and 3567 (Finance) appear in only one dataset.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Solution
‎09-28-2017 10:16 PM
Super User
Posts: 6,629

Re: merge

I think you're looking at this as if the program read:

 

if Emp_D and Emp_N;

 

That statement would select the matches (and there are 3 of those).  However, the IF statement is different.  It is designed to select the mismatches (and there are 2 of those).

Contributor
Posts: 31

Re: merge

Posted in reply to Astounding
Great!thanks!!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 172 views
  • 1 like
  • 3 in conversation