DATA Step, Macro, Functions and more

deleting a row

Reply
Contributor
Posts: 61

deleting a row

Hi,

Below is a table with matched dataset (cases and controls). Out of the five cases, first four cases have a duplicate case with missing values for all variables. How can I delete these row?

Thanks

 

GroupTypeControl Ididageeduraceparitywthtopwofev
1Case..........
1Case.532910905.211
1Control17032910905.210
1Control299351010905.200
2Case..........
2Case.12351212110501
2Control143351211110500
2Control2101331112110500
3Case..........
3Case.222514301105.401
3Control11252513301105.400
3Control2512812301105.400
4Case..........
4Case.2927122195511
4Control1322912221256.210
4Control231271021955.500
5Case.40281032130611
5Control158281032130600
5Control293271132130610
Respected Advisor
Posts: 4,925

Re: deleting a row

data want;
set have;
where id is not missing;
run;
PG
Contributor
Posts: 61

Re: deleting a row

Hi PGStat,

I understand the code will keep thosr rows which do not have missing values. In that scenario, my all cases have first column with missing value. I am afraid it will delete that caso also and this way my all cases would be lost. Please guide me.

Thanks

 

Super User
Posts: 10,028

Re: deleting a row

if cmiss(ControlId,id,age,edu,race,parity,wt,ht,opwo,fev)= 10  then delete;
Contributor
Posts: 61

Re: deleting a row

Hi Ksharp,

 

Please confirm 10 represents the number of variables in the parentheses.

thanks

 

Super User
Posts: 10,028

Re: deleting a row

Yes. Confirm. I thought you know function CMISS() , didn't you ?

Ask a Question
Discussion stats
  • 5 replies
  • 261 views
  • 2 likes
  • 3 in conversation