<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic proc tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23360#M5149</link>
    <description>so i had little proc tabulate exp &amp;amp; cant figure out how to make mine work.  &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 data national;&lt;BR /&gt;
                       &lt;BR /&gt;
  array num [3] n_total n_reas n_noreas;&lt;BR /&gt;
  array pct [3] noreas_pct reas_pct in_pct;&lt;BR /&gt;
&lt;BR /&gt;
  retain  n_total n_reas reas_pct n_noreas noreas_pct in_pct; &lt;BR /&gt;
   set national;&lt;BR /&gt;
  by offtype2;&lt;BR /&gt;
&lt;BR /&gt;
  if first.offtype2 then  &lt;BR /&gt;
	do i = 1 to 3;&lt;BR /&gt;
       num&lt;I&gt; = .;	pct&lt;I&gt; = .;&lt;BR /&gt;
    end;	 &lt;BR /&gt;
&lt;BR /&gt;
	if  _type_ in ('00', '10') then  n_total=n;   &lt;BR /&gt;
	else if _type_ in ('01', '11') then     &lt;BR /&gt;
	do;&lt;BR /&gt;
num[hasreas]=n;&lt;BR /&gt;
&lt;BR /&gt;
      if _type_ = '01' then num[hasreas]=pctn_00;        /* TOTAL ROW */   &lt;BR /&gt;
	  else                    pct[hasreas]=pctn_10;        /* ANY OTHER ROW */&lt;BR /&gt;
    end;&lt;BR /&gt;
&lt;BR /&gt;
  if last.offtype2 then output;&lt;BR /&gt;
&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i keep getting the out of range array error message..&lt;/I&gt;&lt;/I&gt;</description>
    <pubDate>Fri, 24 Apr 2009 19:08:34 GMT</pubDate>
    <dc:creator>Hart</dc:creator>
    <dc:date>2009-04-24T19:08:34Z</dc:date>
    <item>
      <title>proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23360#M5149</link>
      <description>so i had little proc tabulate exp &amp;amp; cant figure out how to make mine work.  &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 data national;&lt;BR /&gt;
                       &lt;BR /&gt;
  array num [3] n_total n_reas n_noreas;&lt;BR /&gt;
  array pct [3] noreas_pct reas_pct in_pct;&lt;BR /&gt;
&lt;BR /&gt;
  retain  n_total n_reas reas_pct n_noreas noreas_pct in_pct; &lt;BR /&gt;
   set national;&lt;BR /&gt;
  by offtype2;&lt;BR /&gt;
&lt;BR /&gt;
  if first.offtype2 then  &lt;BR /&gt;
	do i = 1 to 3;&lt;BR /&gt;
       num&lt;I&gt; = .;	pct&lt;I&gt; = .;&lt;BR /&gt;
    end;	 &lt;BR /&gt;
&lt;BR /&gt;
	if  _type_ in ('00', '10') then  n_total=n;   &lt;BR /&gt;
	else if _type_ in ('01', '11') then     &lt;BR /&gt;
	do;&lt;BR /&gt;
num[hasreas]=n;&lt;BR /&gt;
&lt;BR /&gt;
      if _type_ = '01' then num[hasreas]=pctn_00;        /* TOTAL ROW */   &lt;BR /&gt;
	  else                    pct[hasreas]=pctn_10;        /* ANY OTHER ROW */&lt;BR /&gt;
    end;&lt;BR /&gt;
&lt;BR /&gt;
  if last.offtype2 then output;&lt;BR /&gt;
&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i keep getting the out of range array error message..&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Fri, 24 Apr 2009 19:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23360#M5149</guid>
      <dc:creator>Hart</dc:creator>
      <dc:date>2009-04-24T19:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23361#M5150</link>
      <description>You will want to add some PUTLOG _ALL_;   SAS statements in your DATA step, to debug what's happening along the way - that should help reveal the problem situation and cause.  Also, otherwise having posted the SAS log information which would provide SAS variable values at the time of the error would go along with helping others debug your program.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 24 Apr 2009 19:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate/m-p/23361#M5150</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-04-24T19:18:39Z</dc:date>
    </item>
  </channel>
</rss>

