LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2000, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 15 Nov 2000 12:07:50 +0100
Reply-To:     Per Jensen <perjn@TDK.DK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Per Jensen <perjn@TDK.DK>
Organization: Tele Danmark Internet Cyberspace Launchpad
Subject:      Re: counting "non missing" values
Content-Type: text/plain

Hi

You can use SQL with the COUNT function to do the job. See below.

data test; input @1 var1 2. @3 var2 $1. @5 var3 2.; datalines; 5 X . .. Y . 4 2.6 ; run;

proc sql; create table numcount as select count(distinct var1) as no_var1, count(distinct var2) as no_var2, count(distinct var3) as no_var3 from test; quit;

Good luck

Per

welterh@my-deja.com skrev i meddelelsen <8utkdd$ofp$1@nnrp1.deja.com>... >Hi! > >I would like to count the number of "non-missing" observations, but >don't know how to do it. Is there an easy solution? > >Here my input dataset: > >OBS VAR1 VAR2 VAR3 >1 5 X . >2 . Y . >3 4 . 2.6 > >And heres the answert I would like to have: >VAR1 2 >VAR2 2 >VAR3 1 > >Any suggestions??? > >Cheers >Heiko > > >Sent via Deja.com http://www.deja.com/ >Before you buy.


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