<?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 template in Proc Freq; Change title of the Freq table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713801#M220277</link>
    <description>&lt;P&gt;I want to control the output of the proc freq using proc template and I want to change the title of the plot I output using the option. Here is the code:&lt;/P&gt;&lt;PRE&gt;proc format;
 picture pctfmt (round) other="009.9%";
run;
proc template;
 define crosstabs Base.Freq.CrossTabFreqs;
 cellvalue frequency percent RowPercent ColPercent;
 define frequency;
 format=8.;
 header="Count";
 end;
 define percent;
 format=pctfmt.;
 header="Overall %";
 end;
define RowPercent;
header="Row Pct";
format=6.2;
label="Percent of Row Frequency";
end;
define ColPercent;
header="Col Pct";
format=6.2;
label="Percent of Column Frequency";
end; 
 define header tableof;
 text "Table of " _row_label_ " by " _col_label_;
 end;
 define header rowsheader;
 text " ";
 end;
 define header colsheader;
 text " ";
 end;
 cols_header=colsheader;
 rows_header=rowsheader;
 header tableof;
 end;
 define statgraph Base.Freq.Graphics.ClusterPercentChart;
 /* more code here */
 entrytitle "Distribution of" _row_label "by" _col_label;
run;

/*compare by sex*/
/*R5*/
proc freq data = subset;
label y1p_G_GIRL  = "Gender" R5status = "R5";
title "Table of Gender by R5 status";
table y1p_G_GIRL  * R5status/nopercent chisq plots=freqplot(groupby=column twoway=cluster scale=percent);
format R5status $normal.;
format y1p_G_GIRL  sex.;
run;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gx2144_0-1611542894030.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53855iDE15B38B1B6C0A1E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gx2144_0-1611542894030.png" alt="gx2144_0-1611542894030.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to change the variable name into Gender here using proc template, it seems that it is doable using "define statgraph Base.Freq.Graphics.xxxxxxx;", but I do not what is the plot name should I use in proc template.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for your reply.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 02:50:06 GMT</pubDate>
    <dc:creator>gx2144</dc:creator>
    <dc:date>2021-01-25T02:50:06Z</dc:date>
    <item>
      <title>Proc template in Proc Freq; Change title of the Freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713801#M220277</link>
      <description>&lt;P&gt;I want to control the output of the proc freq using proc template and I want to change the title of the plot I output using the option. Here is the code:&lt;/P&gt;&lt;PRE&gt;proc format;
 picture pctfmt (round) other="009.9%";
run;
proc template;
 define crosstabs Base.Freq.CrossTabFreqs;
 cellvalue frequency percent RowPercent ColPercent;
 define frequency;
 format=8.;
 header="Count";
 end;
 define percent;
 format=pctfmt.;
 header="Overall %";
 end;
define RowPercent;
header="Row Pct";
format=6.2;
label="Percent of Row Frequency";
end;
define ColPercent;
header="Col Pct";
format=6.2;
label="Percent of Column Frequency";
end; 
 define header tableof;
 text "Table of " _row_label_ " by " _col_label_;
 end;
 define header rowsheader;
 text " ";
 end;
 define header colsheader;
 text " ";
 end;
 cols_header=colsheader;
 rows_header=rowsheader;
 header tableof;
 end;
 define statgraph Base.Freq.Graphics.ClusterPercentChart;
 /* more code here */
 entrytitle "Distribution of" _row_label "by" _col_label;
run;

/*compare by sex*/
/*R5*/
proc freq data = subset;
label y1p_G_GIRL  = "Gender" R5status = "R5";
title "Table of Gender by R5 status";
table y1p_G_GIRL  * R5status/nopercent chisq plots=freqplot(groupby=column twoway=cluster scale=percent);
format R5status $normal.;
format y1p_G_GIRL  sex.;
run;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gx2144_0-1611542894030.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53855iDE15B38B1B6C0A1E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gx2144_0-1611542894030.png" alt="gx2144_0-1611542894030.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to change the variable name into Gender here using proc template, it seems that it is doable using "define statgraph Base.Freq.Graphics.xxxxxxx;", but I do not what is the plot name should I use in proc template.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for your reply.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 02:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713801#M220277</guid>
      <dc:creator>gx2144</dc:creator>
      <dc:date>2021-01-25T02:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template in Proc Freq; Change title of the Freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713805#M220281</link>
      <description>The log shows the error:&lt;BR /&gt;error: 856-580: This statement can only be used inside the Begingraph block</description>
      <pubDate>Mon, 25 Jan 2021 03:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713805#M220281</guid>
      <dc:creator>gx2144</dc:creator>
      <dc:date>2021-01-25T03:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template in Proc Freq; Change title of the Freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713807#M220283</link>
      <description>&lt;P&gt;You can get the template name by using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS TRACE ON;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Documentation for ODS TRACE is&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=odsug&amp;amp;docsetTarget=p1fpt3uuow90o3n155hs7bp1mo7f.htm&amp;amp;locale=en" target="_self"&gt;here.)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the template for your plot is Base.Freq.Graphics.StackedPercentChart.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 04:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713807#M220283</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2021-01-25T04:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template in Proc Freq; Change title of the Freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713810#M220286</link>
      <description>&lt;P&gt;Although you can technically do this, using SGPLOT seems infinitely easier. Is that an option?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A few different examples are available here.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/11/27/getting-started-sgplot-part-2-vbar/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2016/11/27/getting-started-sgplot-part-2-vbar/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334360"&gt;@gx2144&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to control the output of the proc freq using proc template and I want to change the title of the plot I output using the option. Here is the code:&lt;/P&gt;
&lt;PRE&gt;proc format;
 picture pctfmt (round) other="009.9%";
run;
proc template;
 define crosstabs Base.Freq.CrossTabFreqs;
 cellvalue frequency percent RowPercent ColPercent;
 define frequency;
 format=8.;
 header="Count";
 end;
 define percent;
 format=pctfmt.;
 header="Overall %";
 end;
define RowPercent;
header="Row Pct";
format=6.2;
label="Percent of Row Frequency";
end;
define ColPercent;
header="Col Pct";
format=6.2;
label="Percent of Column Frequency";
end; 
 define header tableof;
 text "Table of " _row_label_ " by " _col_label_;
 end;
 define header rowsheader;
 text " ";
 end;
 define header colsheader;
 text " ";
 end;
 cols_header=colsheader;
 rows_header=rowsheader;
 header tableof;
 end;
 define statgraph Base.Freq.Graphics.ClusterPercentChart;
 /* more code here */
 entrytitle "Distribution of" _row_label "by" _col_label;
run;

/*compare by sex*/
/*R5*/
proc freq data = subset;
label y1p_G_GIRL  = "Gender" R5status = "R5";
title "Table of Gender by R5 status";
table y1p_G_GIRL  * R5status/nopercent chisq plots=freqplot(groupby=column twoway=cluster scale=percent);
format R5status $normal.;
format y1p_G_GIRL  sex.;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gx2144_0-1611542894030.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53855iDE15B38B1B6C0A1E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gx2144_0-1611542894030.png" alt="gx2144_0-1611542894030.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I want to change the variable name into Gender here using proc template, it seems that it is doable using "define statgraph Base.Freq.Graphics.xxxxxxx;", but I do not what is the plot name should I use in proc template.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking for your reply.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 04:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713810#M220286</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T04:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template in Proc Freq; Change title of the Freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713917#M220322</link>
      <description>Thank you. I used ods trace on but the log error shows:&lt;BR /&gt;error: 856-580: This statement can only be used inside the Begingraph block"</description>
      <pubDate>Mon, 25 Jan 2021 15:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713917#M220322</guid>
      <dc:creator>gx2144</dc:creator>
      <dc:date>2021-01-25T15:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template in Proc Freq; Change title of the Freq table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713919#M220323</link>
      <description>Sgplot is doable. I use proc freq because I can simultaneously output freq table, chart, chisq table and fisher exact table.</description>
      <pubDate>Mon, 25 Jan 2021 15:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-template-in-Proc-Freq-Change-title-of-the-Freq-table/m-p/713919#M220323</guid>
      <dc:creator>gx2144</dc:creator>
      <dc:date>2021-01-25T15:16:13Z</dc:date>
    </item>
  </channel>
</rss>

