LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 17 Mar 2008 21:03:54 -0400
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: how to correct this program. Thanks!
Comments: To: irain168@GMAIL.COM


Given the latest definition of your problem, I still recommend using one of the SAS procs. Does the following proc summary do what you want?

data have; input var1 var2 var3; cards; 1 . 3 2 3 . . 4 5 6 . 8 ;

proc summary data=have; var _all_; output out=missing (drop=_:) nmiss=; run;

Art ------- On Mon, 17 Mar 2008 16:31:23 -0700, Properly <irain168@GMAIL.COM> wrote:

>What I wanted to do is that, I want to create new dataset 'missing' >which include the number of missing values for each variables. >However, my original program (I successfully changed it to fit a large >data set with the help of ART thanks!) shows only 600 variable names >like: missing_var 1,2,3.....600. How can I change the variable names >to the corresponding variables in the original dataset like 'ID, name, >age, gender.....'? What I tried to do is to rename the variable to the >original name after getting the total missing observations for the >variable. But it does not work. How to fix this or are there any >better ways? Thanks so much! > >By the way who can explain what does the "end=eof" and "if eof then >output" mean? > >Thanks $B!* (B > >data missing (keep=missing_var:); > > set originaldataset end=eof; > array all(*) _all_; > array missing_var(600); > retain missing_var; > > do i=1 to dim(all); > if missing(all(i)) then missing_var(i)+1; > > >rename missing_var(i)=all(i); > > > end; > if eof then output; >run; > >Proc print data=missing; >run;

Back to: Top of message | Previous page | Main SAS-L page