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
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):
select count(distinct v1) into :macrovariable separated by ':'
group by v2;
Is there a way to read into a macro variable including zeros?
Thanks a lot!