HI THERE,
I AM TRYING TO EXTRACT A SAMPLE OF FIRMS (WITH THE SAME PERMNO) THAT EXIST FROM FYEAR FROM 2001 TO 2011 AND DELETE THE FIRMS THAT HAS MISSING FYEAR AT THE BEGINNING (2001) OR AT THE END (2011) OR IN BETWEEN.
THNAK yOU FOR THE SUPPORT.
P
Could you explain this a bit more:
"THAT HAS MISSING FYEAR AT THE BEGINNING (2001) OR AT THE END (2011)"
FYEAR takes values 2001 to 2011. If it's missing....How does one know that is 2001 missing? and not 2002??
Could you provide a small sample data?
Could you explain this a bit more:
"THAT HAS MISSING FYEAR AT THE BEGINNING (2001) OR AT THE END (2011)"
FYEAR takes values 2001 to 2011. If it's missing....How does one know that is 2001 missing? and not 2002??
Could you provide a small sample data?
I think this is the answer: count the number of records with years between 2001 and 2011, and only keep those where the result is 11
Proc SQL ;
Crate table want as
Select id
From
(Select id
, count (distinct FYear) as count
From have (where = (FYear between 2001 and 2011))
)
Where count = 11
;
Quit ;
(Untested code)
Richard
Dear anca tilea,
I have attached the sample dataset.
The dataset is a sub-sample data that only include low growth firms. However there are firms which are not consistenly falling within the low growth category from 2001 to 2011 and have missing data in the dataset for few years.As firms can also be facing high growth between 2001 and 2010. I need to select firms which are consistently low growth between from 2001 and 2011 from this sample data.
Thank You.
regds
p
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.