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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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