Date: Fri, 10 Sep 2010 17:18:26 -0400
Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject: Re: Please ignore my prevoius post ( made a mistake there). I
Need To Exclude Rcords Wth All missing values Please help me.
On Fri, 10 Sep 2010 16:29:05 -0400, Tom Smith <need_sas_help@YAHOO.COM>
wrote:
>I have a following dataset with four character variables: subjet, as, de,
>sw, er. I need
>to excluse those observations in result dataset where all variable has
>missing values.
>I tried with CMISS function. but it did not work since I guess my sas is
>8.1, can not use a lot of
>fuction. May be we need to use a datastep.
>
>subjet as de sw er
>------ --- -- -- --
>101 earth moon sun jupitar
>101
>101 moon jupitar
>103
>102 Planet fitness
>102
>103 LA PA JA SA
>103 oper bus car
>
>The result should be as below:
>
>subjet as de sw er
>------ --- -- -- --
>101 earth moon sun jupitar
>101 moon jupitar
>102 Planet fitness
>103 LA PA JA SA
>103 oper bus car
/* test data */
data one;
input id (a b c d) ($);
cards;
1 w x y z
2 . . . .
3 . x y .
;
run;
/* i would do this in sas 9 */
data two;
set one;
where cmiss(a, b, c, d)<4;
run;
/* this should work with sas 8. ^ means NOT */
data three;
set one;
if ^(a=" " and b=" " and c=" " and d=" ");
run;
/* check */
proc print data=three noobs;
run;
/* on lst
id a b c d
1 w x y z
3 x y
*/
|