DATA Step, Macro, Functions and more

Quick Troubleshooting

Reply
Frequent Contributor
Posts: 131

Quick Troubleshooting

Hi, Would anyone be able to provide feedback on why the first four data steps in the picture attached and the last data step do not yield the same number of observations? 

 

I'm not able to paste code using IE as a browser so please let me know if you're unable to open the attachment.

Thank you,


Capture.PNG
Trusted Advisor
Posts: 1,927

Re: Quick Troubleshooting

Posted in reply to Maisha_Huq

How could anyone possibly answer this question? We don't know what your data is.

Frequent Contributor
Posts: 131

Re: Quick Troubleshooting

Posted in reply to PaigeMiller
Thanks, PaigeMiller. Even then it shouldn't technically have been possible to have diff obs given what I d written. Sorry, since the question was short though!
Super User
Posts: 5,511

Re: Quick Troubleshooting

Posted in reply to Maisha_Huq

Two of your subsets, based on q16b, overlap.  By using 4 separate DATA steps, you are including the same observations twice.  When you use just a single WHERE statement that includes all 4 conditions, an observation can be included no more than once.

Frequent Contributor
Posts: 131

Re: Quick Troubleshooting

Posted in reply to Astounding
Thanks, Astounding!
Ask a Question
Discussion stats
  • 4 replies
  • 199 views
  • 1 like
  • 3 in conversation