Hi,
I would like to select data between two dates and then exclude certain firms within those dates.
Dates are identified by TRANDATE (i.e. transaction date)
Firm I.D is based of the variable SIC
I tried to perform this in two steps because I wasn't sure how to do this in one.
I keep unfortunately getting error msg's
data subsamp1;
set table1;
if TRANDATE between '01jan1986'd and '31Dec2003'd then delete;
run;
data subsamp2;
set subsamp1;
if 4900<= SIC <= 4999 or
6000<= SIC <= 6999 then delete;
run;
Hi There,
You have started a new thread. Try this code
data keep reject;
set table1;
if 4900 le SIC le 4999 or 6000 le SIC le 6999 then output reject;
else if '01jan1986'd le TRANDATE le '31Dec2003'd then output reject;
else output keep;
run;
Hi There,
You have started a new thread. Try this code
data keep reject;
set table1;
if 4900 le SIC le 4999 or 6000 le SIC le 6999 then output reject;
else if '01jan1986'd le TRANDATE le '31Dec2003'd then output reject;
else output keep;
run;
Thanks so much... as you can probably tell i'm pretty new to this.
Really appreciate the help
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.