dear all
i have the panel data of nearly 2000 companies for 10 years. for each company, each company is multiple number of board of directors. the number is not same of all the companies. the status of director is either independent or non-independent.
For some companies in the dataset, director status is missing.
i want to delete all the companies which are having missing observation on director status for a concerned year. the same company may not be having any missing observations on director status in other years. so, year-wise, i have to delete the companies which are having such missing observations.
the example of the dataset is as follows
company_name | director | year | director_status |
20 Microns Ltd. | CHANDRESH PARIKH | 2018 | Non-independent |
20 Microns Ltd. | RAJESH PARIKH | 2018 | |
20 Microns Ltd. | ATIL C PARIKH | 2018 | Independent |
20 Microns Ltd. | SUDHIR R PARIKH | 2018 | Independent |
3M India Ltd. | P M SHAH | 2018 | Independent |
3M India Ltd. | R A DEVIDAYAL | 2018 | Independent |
3M India Ltd. | ATUL H PATEL | 2018 | Non-independent |
3M India Ltd. | DARSHA KIKANI (MRS.) | 2018 | Non-independent |
20 Microns Ltd. | AJAY I RANKA (DR.) | 2017 | Non-independent |
20 Microns Ltd. | SEJAL R PARIKH (MRS.) | 2017 | Non-independent |
20 Microns Ltd. | ASHOK SHAH | 2017 | Independent |
20 Microns Ltd. | SAROJINI DIKHALE (MS.) | 2017 | Independent |
3M India Ltd. | SHANTANU PRASAD | 2017 | Independent |
3M India Ltd. | SHASHANK DESAI (DR.) | 2017 | Independent |
3M India Ltd. | GAUTAM DUTTA | 2017 | Non-independent |
3M India Ltd. | SHANTI LAL JAIN | 2017 | Non-independent |
20 Microns Ltd. | PADMANABHAN IYER | 2016 | Non-independent |
20 Microns Ltd. | BHARAT D SHAH | 2016 | Non-independent |
20 Microns Ltd. | RADHIKA RAJAN | 2016 | Independent |
20 Microns Ltd. | BIREN GABHAWALA | 2016 | Independent |
3M India Ltd. | DEBARATI SEN | 2016 | Independent |
3M India Ltd. | B V SHANKARANARAYANA RAO | 2016 | Independent |
3M India Ltd. | ALBERT C WANG | 2016 | |
3M India Ltd. | AMIT LAROYA | 2016 | Non-independent |
In the above data set, i have to delete 20 Microns Ltd.in the year 2018 and 3M India Ltd. in 2016.
please suggest me an appropriate SAS code, to perform the said function.
thanks in advance.
Sort by company_name and year, then do
data want;
merge
have
have (in=d where=(director_status = ''))
;
by company_name year;
if not d;
run;
Hi @srikanthyadav44 See if this helps
proc sql;
create table want as
select *
from have
group by company_name,year
having not sum(director_status=' ');
quit;
Sort by company_name and year, then do
data want;
merge
have
have (in=d where=(director_status = ''))
;
by company_name year;
if not d;
run;
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.