Prev: Macro lists
Next: FORMAT TROUBLE XXXX
From: Marianne Weires on 6 Jan 2010 08:44 Hi, you get 2 as the value for calc as count(ACTUAL) is counting every non-missing value of ACTUAL. In your case that is 6 and 0 (and not "."). Regards, Marianne On Wed, 6 Jan 2010 05:14:05 -0500, SUBSCRIBE SAS-L Joe H. Smith <peesari.mahesh(a)GMAIL.COM> wrote: >Hi all, > >I am submitting the following code ..i get wrong values for the count of actual >... > >data try1; >input FAcility_RK ITEM_RK DEMAND_DT mmddyy10. ACTUAL PREDICT; >format DEMAND_DT date9.; >cards; >40 121 10/1/2010 . 0 >40 234 10/1/2008 0 0 >40 234 1/1/2009 0 0 >40 234 4/1/2009 0 0 >40 234 7/1/2009 0 0 >40 234 10/1/2009 . 0 >40 234 1/1/2010 . 0 >40 234 4/1/2010 . 0 >40 234 7/1/2010 . 0 >40 234 10/1/2010 . 0 >40 291 4/1/2009 6 6 >40 291 7/1/2009 0 0 >40 291 10/1/2009 . 0 >40 291 1/1/2010 . 0 >40 291 4/1/2010 . 0 >40 291 7/1/2010 . 0 >40 291 10/1/2010 . 0 >40 301 10/1/2008 0 0 >40 301 1/1/2009 0 0 >40 301 4/1/2009 0 0 >40 301 7/1/2009 0 0 >; >run; >proc print; >run; >proc sql; > create table test78 as > select FAcility_RK,ITEM_RK,DEMAND_DT ,ACTUAL,PREDICT,count(ACTUAL) >as calc > from try1 group by FAcility_RK,ITEM_RK; > quit; >output is .. > >FAcility_RK ITEM_RK DEMAND_DT ACTUAL PREDICT calc >40 121 10/1/2010 0 0 >40 234 10/1/2009 0 4 >40 234 1/1/2010 0 4 >40 234 1/1/2009 0 0 4 >40 234 10/1/2010 0 4 >40 234 7/1/2010 0 4 >40 234 7/1/2009 0 0 4 >40 234 10/1/2008 0 0 4 >40 234 4/1/2009 0 0 4 >40 234 4/1/2010 0 4 >40 291 1/1/2010 0 2 >40 291 4/1/2010 0 2 >40 291 10/1/2009 0 2 >40 291 7/1/2009 0 0 2 >40 291 4/1/2009 6 6 2(y do iget 2 instead of 1) >40 291 10/1/2010 0 2 >40 291 7/1/2010 0 2 >40 301 7/1/2009 0 0 4 >40 301 4/1/2009 0 0 4 >40 301 1/1/2009 0 0 4 >40 301 10/1/2008 0 0 4 > >plz guide me where i am doing wrong. > >Thanks all
|
Pages: 1 Prev: Macro lists Next: FORMAT TROUBLE XXXX |