<?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 Macro for Frequency Table output with Variable Label &amp; Value Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-Frequency-Table-output-with-Variable-Label-Value/m-p/11397#M1043</link>
    <description>Can anybody be kind of help solving the problem in my Macro?&lt;BR /&gt;
&lt;BR /&gt;
The data is from a large scale survey. The purpose of this macro is to generate and output a distribution.frequency results of a specified variable as a file, within the file the variable lable is used instead of variable, and the recoded value of the variable is used ithrough Variable format instead of the original variable value. Variable has already been formated/recoded.&lt;BR /&gt;
&lt;BR /&gt;
Since the variable label is too long, so I want to assign a macro variable to it first.&lt;BR /&gt;
&lt;BR /&gt;
The SAS codes are as the following:&lt;BR /&gt;
&lt;BR /&gt;
%let Q1_label='abcdefgh';&lt;BR /&gt;
&lt;BR /&gt;
%macro f_freq(var, var_w, var_label); &lt;BR /&gt;
proc freq data= clean_data order=freq;&lt;BR /&gt;
table &amp;amp;var /out=freqout.freq_&amp;amp;var;&lt;BR /&gt;
format &amp;amp;var &amp;amp;var_w;&lt;BR /&gt;
label &amp;amp;var=&amp;amp;var_label;&lt;BR /&gt;
run;  	&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%f_freq(Q1,Q1_w., Q1_label);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Great thanks in advance.</description>
    <pubDate>Wed, 16 Apr 2008 19:04:50 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-04-16T19:04:50Z</dc:date>
    <item>
      <title>Macro for Frequency Table output with Variable Label &amp; Value Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-Frequency-Table-output-with-Variable-Label-Value/m-p/11397#M1043</link>
      <description>Can anybody be kind of help solving the problem in my Macro?&lt;BR /&gt;
&lt;BR /&gt;
The data is from a large scale survey. The purpose of this macro is to generate and output a distribution.frequency results of a specified variable as a file, within the file the variable lable is used instead of variable, and the recoded value of the variable is used ithrough Variable format instead of the original variable value. Variable has already been formated/recoded.&lt;BR /&gt;
&lt;BR /&gt;
Since the variable label is too long, so I want to assign a macro variable to it first.&lt;BR /&gt;
&lt;BR /&gt;
The SAS codes are as the following:&lt;BR /&gt;
&lt;BR /&gt;
%let Q1_label='abcdefgh';&lt;BR /&gt;
&lt;BR /&gt;
%macro f_freq(var, var_w, var_label); &lt;BR /&gt;
proc freq data= clean_data order=freq;&lt;BR /&gt;
table &amp;amp;var /out=freqout.freq_&amp;amp;var;&lt;BR /&gt;
format &amp;amp;var &amp;amp;var_w;&lt;BR /&gt;
label &amp;amp;var=&amp;amp;var_label;&lt;BR /&gt;
run;  	&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%f_freq(Q1,Q1_w., Q1_label);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Great thanks in advance.</description>
      <pubDate>Wed, 16 Apr 2008 19:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-Frequency-Table-output-with-Variable-Label-Value/m-p/11397#M1043</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-16T19:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Frequency Table output with Variable Label &amp; Value Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-Frequency-Table-output-with-Variable-Label-Value/m-p/11398#M1044</link>
      <description>Perhaps&lt;BR /&gt;
%f_freq(Q1,Q1_w., Q1_label);&lt;BR /&gt;
&lt;BR /&gt;
should be&lt;BR /&gt;
%f_freq(Q1,Q1_w., &amp;amp;Q1_label);&lt;BR /&gt;
&lt;BR /&gt;
Also, check your quoting.  Use some %put statements to help you see what the macro variables really contain.&lt;BR /&gt;
&lt;BR /&gt;
Next.&lt;BR /&gt;
I believe the format and the label are used for reporting/printing/display purposes.&lt;BR /&gt;
I don't think they will affect the aggregation.&lt;BR /&gt;
Am I mis-interpreting your intent?&lt;BR /&gt;
Since I haven't used proc freq in ages, I may be wrong in my interpretation of what it will do.</description>
      <pubDate>Thu, 17 Apr 2008 13:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-Frequency-Table-output-with-Variable-Label-Value/m-p/11398#M1044</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-17T13:27:55Z</dc:date>
    </item>
  </channel>
</rss>

