<?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 Re: SAS warning on pro tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855587#M338127</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the explanation. You are right, the macro is hard-coded. I do not know enough about macro to resolve this problem. Please can you provide more example as to how I can&amp;nbsp;&lt;SPAN&gt;modify the macro program to skip the loop or how I can check (&amp;amp;&amp;amp;var_&amp;amp;j) to remove the variable. Thanks again&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 16:05:51 GMT</pubDate>
    <dc:creator>CathyVI</dc:creator>
    <dc:date>2023-01-25T16:05:51Z</dc:date>
    <item>
      <title>SAS warning on pro tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855577#M338119</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am familiar with this issue but cant fix it. I'm getting the following error from pro tabulate:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;WARNING: A class variable is crossed with itself in the table statement at line 867. This may cause unpredictable results.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;WARNING: A class variable is crossed with itself in the table statement at line 867. This may cause unpredictable results.&lt;/FONT&gt;&lt;BR /&gt;NOTE: There were 5361 observations read from the data set WORK.AGE.&lt;BR /&gt;NOTE: PROCEDURE TABULATE used (Total process time):&lt;BR /&gt;real time 1.16 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is as a result of a cross tab of the same variable however, I do not know how to resolve the issue in this code (FYI: I found the code online and modified it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a part of the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro do_freq_gender;&lt;BR /&gt;%do j=1 %to &amp;amp;numvars;&lt;BR /&gt;proc tabulate data=gender;&lt;BR /&gt;class gender &amp;amp;&amp;amp;var_&amp;amp;j. ;&lt;BR /&gt;table (&amp;amp;&amp;amp;var_&amp;amp;j. all),&lt;BR /&gt;(gender all='All') * (N colpctn='% of Col');&lt;BR /&gt;format gender sexf.&lt;BR /&gt;&amp;amp;&amp;amp;var_&amp;amp;j. &amp;amp;&amp;amp;fmt_&amp;amp;j.;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help please. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855577#M338119</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2023-01-25T15:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS warning on pro tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855584#M338125</link>
      <description>Hi: My guess is that your variable list also contains GENDER, which is a problem because you have GENDER hard-coded in the TABLE statement, so if GENDER is in your list of variables that you're looping through, when it's crossed with itself, it will generate an error. You don't show how your list &amp;amp;&amp;amp;var_&amp;amp;j is generated, but my guess is that you'll need to verify that GENDER is NOT in the list or else modify the macro program to skip the loop when the value of &amp;amp;&amp;amp;var_&amp;amp;j is equal to GENDER.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 25 Jan 2023 15:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855584#M338125</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-01-25T15:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS warning on pro tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855587#M338127</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the explanation. You are right, the macro is hard-coded. I do not know enough about macro to resolve this problem. Please can you provide more example as to how I can&amp;nbsp;&lt;SPAN&gt;modify the macro program to skip the loop or how I can check (&amp;amp;&amp;amp;var_&amp;amp;j) to remove the variable. Thanks again&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855587#M338127</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2023-01-25T16:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS warning on pro tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855596#M338132</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the explanation. You are right, the macro is hard-coded. I do not know enough about macro to resolve this problem. Please can you provide more example as to how I can&amp;nbsp;&lt;SPAN&gt;modify the macro program to skip the loop or how I can check (&amp;amp;&amp;amp;var_&amp;amp;j) to remove the variable. Thanks again&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You macro code is using multiple variables that do not appear in the macro definition so it is not easy to address. You would have to include the code used to create all of those macro variables. That would likely be the better place to address things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that Proc Tabulate can contain multiple CLASS, VAR and Table statements. So if this code is supposed to be looping over the same data set multiple times and creating separate tables for each variable then the entire process should be looked at as each time the procedure is called with the same data set your code reloads the data. With moderate to large datasets this could result in considerable times.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855596#M338132</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-25T16:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS warning on pro tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855600#M338135</link>
      <description>Yes, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; is correct. It would be better to address the issue of GENDER in the code that creates &amp;amp;&amp;amp;var_&amp;amp;j and &amp;amp;&amp;amp;fmt_&amp;amp;j.&lt;BR /&gt;  But without the data and ALL the code and some idea of the desired results, it is hard to determine whether you really need multiple PROC TABULATE steps or whether it would be better to have one PROC TABULATE with multiple TABLE statements.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 25 Jan 2023 16:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-warning-on-pro-tabulate/m-p/855600#M338135</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-01-25T16:54:48Z</dc:date>
    </item>
  </channel>
</rss>

