<?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: Proc Freq Macro Variable List in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471924#M285783</link>
    <description>&lt;P&gt;Two questions to start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, are the values of VARIABLE_1 and VARIABLE_2 always correctly spelled variable names?&amp;nbsp; AGE_CATEGORY would be correct name, but AGE CATEGORY would (under normal circumstances) be invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, which cross tabs do you want?&amp;nbsp; The code you are posting, if it had worked, would generate 4 cross-tabs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;state * year&lt;/P&gt;
&lt;P&gt;state * own_pets&lt;/P&gt;
&lt;P&gt;age_category * year&lt;/P&gt;
&lt;P&gt;age_category * own_pets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you looking for all four, or just the first and last ones?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 21:02:03 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-06-20T21:02:03Z</dc:date>
    <item>
      <title>Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471917#M285781</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, sorry for posting if this is the wrong place! I'm trying to learn macros better, well macros at all, and I was just given this project that would probably be made simpler by using macros. I need to do a bunch of cross tabs of variables that are in the same dataset. I have a dataset that contains the list of variables to cross tab. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Variable 1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Variable 2&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;state&lt;/TD&gt;&lt;TD&gt;year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;age category&lt;/TD&gt;&lt;TD&gt;own pets&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote code, which I think pulled in the two sets&amp;nbsp;variable names:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; all;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"var1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, variable_1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"var2"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, variable_2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Then I wrote my Proc Freq code:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=vars;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;tables&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&amp;amp;var1&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;*(&amp;amp;var2&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; /&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;norow&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nocol&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nopercent&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;missing&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;The code runs, except that it only outputs the last crosstab. In this case (using fake variable names), age category by own pets. I would like &lt;EM&gt;all &lt;/EM&gt;of the crosstabs to be generated by row, not just the last one. What am I doing wrong? Or would an array work better? &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Any thoughts/suggestions would be much appreciated!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks in advance for your help!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 20:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471917#M285781</guid>
      <dc:creator>cc1986</dc:creator>
      <dc:date>2018-06-20T20:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471918#M285782</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;all;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;symput(&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"var1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, variable_1); &amp;lt;- gets reset at each line;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;symput(&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"var2"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, variable_2);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;You're macro variables VAR1 and Var2 are getting created only at the last line because you're reusing the same macro variables so it's overwritten each time. You don't go into enough detail, but I would probably create my PROC FREQ as a macro and pass the parameters to the macro call instead using CALL EXECUTE.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro myFreq(var1, var2);

proc freq data=vars;

tables (&amp;amp;var1.)*(&amp;amp;var2.) /norow nocol nopercent missing;

run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Then for each line pass the values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set all;

str = catt('%myFreq(', var1, ', ', var2, ');');

call execute(str);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114961"&gt;@cc1986&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, sorry for posting if this is the wrong place! I'm trying to learn macros better, well macros at all, and I was just given this project that would probably be made simpler by using macros. I need to do a bunch of cross tabs of variables that are in the same dataset. I have a dataset that contains the list of variables to cross tab. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;Variable 1&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;Variable 2&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;state&lt;/TD&gt;
&lt;TD&gt;year&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;age category&lt;/TD&gt;
&lt;TD&gt;own pets&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote code, which I think pulled in the two sets&amp;nbsp;variable names:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; all;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"var1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, variable_1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"var2"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, variable_2);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Then I wrote my Proc Freq code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=vars;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;tables&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&amp;amp;var1&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;*(&amp;amp;var2&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; /&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;norow&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;nocol&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;nopercent&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;missing&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;The code runs, except that it only outputs the last crosstab. In this case (using fake variable names), age category by own pets. I would like &lt;EM&gt;all &lt;/EM&gt;of the crosstabs to be generated by row, not just the last one. What am I doing wrong? Or would an array work better? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Any thoughts/suggestions would be much appreciated!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks in advance for your help!&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 20:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471918#M285782</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-20T20:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471924#M285783</link>
      <description>&lt;P&gt;Two questions to start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, are the values of VARIABLE_1 and VARIABLE_2 always correctly spelled variable names?&amp;nbsp; AGE_CATEGORY would be correct name, but AGE CATEGORY would (under normal circumstances) be invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, which cross tabs do you want?&amp;nbsp; The code you are posting, if it had worked, would generate 4 cross-tabs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;state * year&lt;/P&gt;
&lt;P&gt;state * own_pets&lt;/P&gt;
&lt;P&gt;age_category * year&lt;/P&gt;
&lt;P&gt;age_category * own_pets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you looking for all four, or just the first and last ones?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 21:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/471924#M285783</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-06-20T21:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/472199#M285784</link>
      <description>&lt;P&gt;Or perhaps to avoid reloading the data set for each table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   set all end=last;
   if _n_=1 then call execute("proc freq data=vars;");
   call execute (catx(' ','tables ',variable_1,'*',variable_2,'/norow nocol nopercent missing;'));
   if last then call execute('run;');
run;&lt;/PRE&gt;
&lt;P&gt;This assumes the data set all contains the pairings you want in variable_1 and variable_2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 16:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/472199#M285784</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-21T16:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/551276#M285785</link>
      <description>&lt;P&gt;If I understand your question correctly, try using an &lt;FONT size="4" color="#3366FF"&gt;out=work.xxx&lt;/FONT&gt; after the &lt;FONT face="arial black,avant garde" size="3"&gt;'/'&lt;/FONT&gt; to output all the rows to a SAS dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;change xxx to a sas ds name of your chosing. If ou want to catalogue the output dataset, change work. to a permanent library name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Then I wrote my Proc Freq code:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=vars;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;tables&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(&amp;amp;var1&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;*(&amp;amp;var2&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;norow&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;nocol&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;nopercent&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;missing &lt;/FONT&gt;&lt;FONT face="Courier New" size="4" color="#0000ff"&gt;&lt;STRONG&gt;out=work.xxx&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;good luck!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 22:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/551276#M285785</guid>
      <dc:creator>avellani</dc:creator>
      <dc:date>2019-04-15T22:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/551280#M285786</link>
      <description>&lt;P&gt;First note that AGE CATEGORY is not a valid variable name unless you have set the option VALIDVARNAME to ANY. And even then it can only be used in code by making a name literal out of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only want to take the combinations that exist in your dataset then you could perhaps just get by with creating a simple macro variable with the X*Y combinations.&amp;nbsp; You can then use the macro variable in your TABLES statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select catx('*',nliteral(variable1),nliteral(variable2))
  into :table_list separated by ' '
from ALL
;
quit;
proc freq data=VARS;
  tables &amp;amp;table_list ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 23:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/551280#M285786</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-15T23:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq Macro Variable List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/551289#M285787</link>
      <description>Thanks so much. I'll try it tomorrow and let you know how it goes.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Apr 2019 01:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Macro-Variable-List/m-p/551289#M285787</guid>
      <dc:creator>avellani</dc:creator>
      <dc:date>2019-04-16T01:55:18Z</dc:date>
    </item>
  </channel>
</rss>

