04
Dez 10
By Kawamura, às 16:51link do post | Comments

 

 

data pqval.table_2;

set pqval.table_1;

array edf[60] EDF_Oct_2005 EDF_Nov_2005 EDF_Dec_2005 EDF_Jan_2006 EDF_Feb_2006 EDF_Mar_2006

                      EDF_Apr_2006 EDF_May_2006 EDF_Jun_2006 EDF_Jul_2006 EDF_Aug_2006 EDF_Sep_2006

                      EDF_Oct_2006 EDF_Nov_2006 EDF_Dec_2006 EDF_Jan_2007 EDF_Feb_2007 EDF_Mar_2007

                      EDF_Apr_2007 EDF_May_2007 EDF_Jun_2007 EDF_Jul_2007 EDF_Aug_2007 EDF_Sep_2007

                      EDF_Oct_2007 EDF_Nov_2007 EDF_Dec_2007 EDF_Jan_2008 EDF_Feb_2008 EDF_Mar_2008

                      EDF_Apr_2008 EDF_May_2008 EDF_Jun_2008 EDF_Jul_2008 EDF_Aug_2008 EDF_Sep_2008

                      EDF_Oct_2008 EDF_Nov_2008 EDF_Dec_2008 EDF_Jan_2009 EDF_Feb_2009 EDF_Mar_2009

                      EDF_Apr_2009 EDF_May_2009 EDF_Jun_2009 EDF_Jul_2009 EDF_Aug_2009 EDF_Sep_2009

                      EDF_Oct_2009 EDF_Nov_2009 EDF_Dec_2009 EDF_Jan_2010 EDF_Feb_2010 EDF_Mar_2010

                      EDF_Apr_2010 EDF_May_2010 EDF_Jun_2010 EDF_Jul_2010 EDF_Aug_2010 EDF_Sep_2010;

    do i = 1 to 60;

      if i = 1 then do;

           num_edf = 0;

             sum_edf=0;

        end;

      if edf[i] = . then do;

                  num_edf = num_edf;

                  sum_edf = sum_edf;

                  end;

      else do;

                  num_edf = num_edf + 1;

                  sum_edf = edf[i] + sum_edf;

                  end;

        if i = 60 then do;

         tot_num_edf = num_edf;

             tot_sum_edf = sum_edf;

             average_edf=sum_edf/num_edf;

             if tot_num_edf = 0 then average_edf_Flag = 0;

             else                    average_edf_flag = 1;

        end;

   end;

run;

 

 

 

Don't you just love a good piece of SAS code for tea time on a Saturday? yummy yummy yummy yummy yummy........

 


oi? 8)
F. a 5 de Dezembro de 2010 às 05:07