Hello
I want to select all numbers from have data set that meet following condition:
If number is lower than 10000 and dividable by 1000 then Ind=1
IF number higher than 10000 and dividable by 5000 then Ind=1
else Ind=0
At the end need to select only rows with Ind=1
Data have;
input X;
cards;
750
800
900
1000
1800
3000
2900
8000
8200
8500
43000
50000
90001
90000
95000
96000
;
Run;
Use the MOD function, e.g.
if mod(x,1000) = 0
I leave the rest of the condition to you.
Use the MOD function, e.g.
if mod(x,1000) = 0
I leave the rest of the condition to you.
I'd really love sometimes to have more options than only a Thumbs Up Like as comment.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.