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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.