I don't know what kind of data you have, but is this what you mean?
data have;
input dt:yymmdd8.;
format dt yymmdd8.;
datalines;
20110405
20120604
20130806
20140603
20150607
20160705
;
run;
data want;
set have;
if '06AUG2013'd <= dt <= '07JUN2015'd;
run;
data want;
set have;
if 3 <= ID <= 5;
run;
Provide the correct data and structure before asking questions.
Do you want to filter by ID or by date, and are the values like date character values or numeric values?
data have;
input date :yymmdd8. @@;
format date yymmdd10.;
cards;
20110405 20120604 20130806 20140603 20150607 20160705
;
data want;
set have;
if date>='08JUN2013'd and date<='06JUL2015'd;
run;
/*if type of variable date = numeric */
data have;
input date ;
cards;
20110405
20120604
20130806
20140603
20150607
20160705
;run;
data want;
set have;
if 20130806 <= date <= 20150607;
run;
/*if type of variable date = character */
data have;
input date $ ;
cards;
20110405
20120604
20130806
20140603
20150607
20160705
;run;
data want;
set have;
if '20130806' <= date <= '20150607';
run;
/*if type of variable date = date sas */
data have;
input date yymmdd8. ;
cards;
20110405
20120604
20130806
20140603
20150607
20160705
;run;
data want;
set have;
if '06AUG2013'd <= date <= '07JUN2015'd;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.