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 (October 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 21 Oct 2008 17:30:54 -0500
Reply-To:     "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Subject:      Re: how to output number of missing values of a text variable on
              a table?
Comments: To: Haris <Karovaldas@gmail.com>
In-Reply-To:  <9afa2a6f-df2f-4d19-9a55-b7b1b98a76fb@k30g2000hse.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

Using the MISSING function this can be simplified somewhat.

proc sql; select catx(' ','sum(missing(',name,')) as', name) into :syntax separated by ", " from dictionary.columns where Libname = "WORK" AND MemName = "MISSING" ; %put NOTE: GENERATED SYNTAX: %bquote(&syntax); select &Syntax from Missing; quit;

On 10/21/08, Haris <Karovaldas@gmail.com> wrote: > How about something like this: > > data missing ; > input a 1 b$ 3 c 5 ; > cards ; > 1 a 1 > 2 . 2 > 3 a . > . a 4 > 5 a 5 > 6 . . > . a 7 > 8 a . > 9 . 9 > ; > > proc sql ; > select case > when type='num' then 'sum(' || name || '= . ) as ' || name > when type='char' then 'sum(' || name || "= '' ) as " || name > end > into :syntax separated by ", " > from dictionary.columns > where Libname = "WORK" AND MemName = "MISSING" ; > quit ; > > proc sql ; > select &Syntax > from Missing ; > quit ; >


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