DATA Step, Macro, Functions and more

A fundamental question.

Reply
N/A
Posts: 0

A fundamental question.

I have an original data set, ORIGINAL, with 521 237 records, and with several variables. Two of them are VAR1 and VAR2, both numeric varibles.

I run this code:

data out1;
set original;
if var1<100;
run;

Data set OUT1 then has 20 124 records.

Then I start from the beginnning again and run this code:

data out2(where=(var2=7));
set original;
if var1<100;
run;

Data set OUT2 then has 28 784 records.

This is very strange. I get more records that saitsfies the if condition when I have a smaller subset.

Can you think of any situation where this could happen?
Super Contributor
Super Contributor
Posts: 3,174

Re: A fundamental question.

Come on - need to see the SAS log output for this type of question. We're working with computers here, not voodoo. Reply to your post and paste all of the SAS log output - remember to show all SAS code executed, obviously for as many DATA steps (or otherwise) invoked to get to your conclusion/observation, please. Without this additional diagnostic info, anyone's reply is a crap-shoot.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 1 reply
  • 107 views
  • 0 likes
  • 2 in conversation