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 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 23 Feb 2006 05:09:40 -0500
Reply-To:     Hadassa Brunschwig <dassybr@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Hadassa Brunschwig <dassybr@HOTMAIL.COM>
Subject:      proc sql: count into macro variable including zeros

Hi SAS-users!

I am trying to count a variable (say v1) grouped by another variable (say v2) into a macro variable. Now I am not particularly interested in the numbers that result; what I would like to know is for which values of v2 the count is zero. By running the following code there will never be zeros for values of v2 that do not exist in the dataset (but should theoretically, so I need to include them in the code):

proc sql; select count(distinct v1) into :macrovariable separated by ':' from dataset group by v2; quit;

Is there a way to read into a macro variable including zeros?

Thanks a lot!

Cheers,

Hadassa


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