DATA Step, Macro, Functions and more

Why zero observation ?

Accepted Solution Solved
Reply
Contributor
Posts: 29
Accepted Solution

Why zero observation ?

why output of this program contains no observation ? can anyone explain it to me...thanks 

 

Given data : 

money dataset has 5 observations.

people dataset has observations

 

My program is : 

 

data empsal;

     set money (in=money) people(in=people);

     if money and people;

run;

empsal contains 0 observations...why so ? Smiley Sad

 


Accepted Solutions
Solution
‎06-22-2016 10:24 AM
Super User
Super User
Posts: 7,401

Re: Why zero observation ?

You are "setting" the second dataset After the first, there is no merge, hence:

     if money and people;

Is never true, the records all come from money in the first instance, and then from people in the second, never both.  Perhaps you mean to merge the data?

View solution in original post


All Replies
Solution
‎06-22-2016 10:24 AM
Super User
Super User
Posts: 7,401

Re: Why zero observation ?

You are "setting" the second dataset After the first, there is no merge, hence:

     if money and people;

Is never true, the records all come from money in the first instance, and then from people in the second, never both.  Perhaps you mean to merge the data?

Contributor
Posts: 29

Re: Why zero observation ?

no with respect to merge i know how this program gonna behave....thanks for your valuable response.

Understood the concept !
☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 191 views
  • 1 like
  • 2 in conversation