BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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_namedirector yeardirector_status
20 Microns Ltd.CHANDRESH PARIKH2018Non-independent
20 Microns Ltd.RAJESH PARIKH2018 
20 Microns Ltd.ATIL C PARIKH2018Independent
20 Microns Ltd.SUDHIR R PARIKH2018Independent
3M India Ltd.P M SHAH2018Independent
3M India Ltd.R A DEVIDAYAL2018Independent
3M India Ltd.ATUL H PATEL2018Non-independent
3M India Ltd.DARSHA KIKANI (MRS.)2018Non-independent
20 Microns Ltd.AJAY I RANKA (DR.)2017Non-independent
20 Microns Ltd.SEJAL R PARIKH (MRS.)2017Non-independent
20 Microns Ltd.ASHOK SHAH2017Independent
20 Microns Ltd.SAROJINI DIKHALE (MS.)2017Independent
3M India Ltd.SHANTANU PRASAD2017Independent
3M India Ltd.SHASHANK DESAI (DR.)2017Independent
3M India Ltd.GAUTAM DUTTA2017Non-independent
3M India Ltd.SHANTI LAL JAIN2017Non-independent
20 Microns Ltd.PADMANABHAN IYER2016Non-independent
20 Microns Ltd.BHARAT D SHAH2016Non-independent
20 Microns Ltd.RADHIKA RAJAN2016Independent
20 Microns Ltd.BIREN GABHAWALA2016Independent 
3M India Ltd.DEBARATI SEN2016Independent
3M India Ltd.B V SHANKARANARAYANA RAO2016Independent
3M India Ltd.ALBERT C WANG2016 
3M India Ltd.AMIT LAROYA2016Non-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. 

 

1 ACCEPTED SOLUTION
2 REPLIES 2
novinosrin
Tourmaline | Level 20

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 849 views
  • 2 likes
  • 3 in conversation