DATA Step, Macro, Functions and more

Interval definition for IN operator

Reply
N/A
Posts: 0

Interval definition for IN operator

Is there a way to define an interval for the IN operator?

Instead of:
IN (1 2 3 4 5)

Use something similar to:
IN (1-5)?
Respected Advisor
Posts: 3,777

Re: Interval definition for IN operator

close use colon.

[pre]
441 data _null_;
442 do _n_ = 1 to 10;
443 if _n_ in(3:7) then put _n_=;
444 end;
445 run;

_N_=3
_N_=4
_N_=5
_N_=6
_N_=7
[/pre]
N/A
Posts: 0

Re: Interval definition for IN operator

Thanks a lot!
Ask a Question
Discussion stats
  • 2 replies
  • 128 views
  • 0 likes
  • 2 in conversation