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
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: