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
Respected Advisor
Posts: 2,981

Re: Quick Troubleshooting

Posted in reply to Maisha_Huq

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

--
Paige Miller
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: 6,751

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
  • 217 views
  • 1 like
  • 3 in conversation