BookmarkSubscribeRSS Feed
wajmsu
Obsidian | Level 7

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
5 REPLIES 5
PGStats
Opal | Level 21
data want;
set have;
where id is not missing;
run;
PG
wajmsu
Obsidian | Level 7

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

 

Ksharp
Super User
if cmiss(ControlId,id,age,edu,race,parity,wt,ht,opwo,fev)= 10  then delete;
wajmsu
Obsidian | Level 7

Hi Ksharp,

 

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

thanks

 

Ksharp
Super User

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 902 views
  • 2 likes
  • 3 in conversation