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 (February 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 25 Feb 2007 12:27:47 -0500
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Question about NMISS
Comments: To: Ron Fehd <rjf2@CDC.GOV>

Is there a way to specify an array in a function like nmiss or sum?

I tried (I think) Ron's suggested solution, but got the following error:

data test; input diasbp sysbp pulse heartrt temp htcm wtkg; cards; 1 2 3 4 5 6 7 1 . 3 4 5 6 7 ; run;

data want; set test; array Measures(*) diasbp sysbp pulse heartrt temp htcm wtkg; if nmiss( of Measures) eq dim(Measures) then delete; run;

ERROR: Illegal reference to the array Measures.

Art -------- On Fri, 23 Feb 2007 16:17:54 -0500, Fehd, Ronald J. (CDC/CCHIS/NCPHI) <rjf2@CDC.GOV> wrote:

>> From: Sridhar, Nagakumar >> I am trying to do something like this: >> >> if diasbp=. and sysbp=. and pulse=. and heartrt=. and temp=. >> and htcm=. >> and wtkg=. then delete; >> >> And was advised (by my boss) to use the NMISS function. But >> when I did the following (and I am not sure if the 2 >> statements mean the same): >> >> if nmiss(of diasbp,sysbp,pulse,heartrt,temp,htcm,wtkg)< 7 then delete; >> >> I get different results. Can somebody be kind enough to >> explain to me what the right syntax is? > >change less than > >if nmiss(of diasbp,sysbp,pulse,heartrt,temp,htcm,wtkg) > < 7 then delete; >...^ > >to equal > >if nmiss(of diasbp,sysbp,pulse,heartrt,temp,htcm,wtkg) > = 7 then delete; >...^ > >you might want to examine placing all your variables in an array: > >array Measures(*) diasbp sysbp pulse heartrt temp htcm wtkg; > >if nmiss( of Measures) eq dim(Measures) then delete; > >this is easier to read >and whenever you change the var list in the array statement >your code testing for nmiss >does not break later in the program. > >Ron Fehd the less is better > or easier to read > or macro maven CDC Atlanta GA USA RJF2 at cdc dot gov


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