BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ronein
Onyx | Level 15

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;

 

1 ACCEPTED SOLUTION
3 REPLIES 3
Patrick
Opal | Level 21

@Kurt_Bremser 🤣

I'd really love sometimes to have more options than only a Thumbs Up Like as comment.

Ronein
Onyx | Level 15
if x<=10000 and mod(x,1000) = 0 then ind=1:
Else if x>10000 and mod(x,5000)=0 then ind=1:
Else ind=0;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 3 replies
  • 1111 views
  • 2 likes
  • 3 in conversation