Hello;
I have a variable in a data called numbers and in the variable there are a set with numbers in it - lets say 1 to 9000.
I need to find any numbers that are not in the sequence - how do I do that?
Thanks
This was my idea then merge but is not working.
data verify;
set test;
do var = min(1) to max(9000); output;
end; drop min max; run;
data test1;
merge verify test; by number;
proc freq; data=test;
run;
This was my idea then merge but is not working.
data verify;
set test;
do var = min(1) to max(9000); output;
end; drop min max; run;
data test1;
merge verify test; by number;
proc freq; data=test;
run;
Your log is probably full of errors because that's not valid code. This should get you started:
*generate verification data set;
data verify;
flag=1;
do number= 1 to 9000;
output;
end;
run;
*use IN data set options to identify where a record is coming from or use flag;
data test;
merge verify (in=t1) test (in=t2);
by number;
missing=0;
if t1 and not t2 then missing=1;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.