BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 860 views
  • 0 likes
  • 2 in conversation