<?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: Customize ODS OUTPUT to create the Statistics table from a specific procedure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733069#M228443</link>
    <description>&lt;P&gt;Thank you, Tom, for your explanation!&lt;/P&gt;
&lt;P&gt;I have a large data set with a mix of continuous and categorical variables. For the first round of conversation among our team, I am preparing summary tables for our&amp;nbsp;continuous and categorical variables. I copied the example tables below for the age of the participants as AGE_IN_YEARS and the age category of parents as&amp;nbsp;AGE_GROUPS_PARENTS. Among the options you mentioned, I am using proc print. Basically, I save the output results in the output datasets:&lt;/P&gt;
&lt;P&gt;ods output Summary=Output; for the continuous variables&lt;/P&gt;
&lt;P&gt;ods output OneWay=Output; for the categorical variables&lt;/P&gt;
&lt;P&gt;Then, use PROC PRINT to print the Output dataset in a Word file.&lt;/P&gt;
&lt;P&gt;I am working to make a MACRO to avoid repetition. I would love to know if there is an easier way to do this.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;Age [AGE_IN_YEARS]&amp;nbsp;How old are you today? (years)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Mean&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12.25&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Standard Deviation 1.17&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;95% CI&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13.61%, 14.18%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;N&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2500&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;Age category of parents [AGE_GROUPS_PARENTS]&amp;nbsp;Age in categories. (years)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Frequency&amp;nbsp; Percent&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 95% CI&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;16-25 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 515 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20.8%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18.2%, 23.4%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;26-35 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 526 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21.3%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19.1%, 23.4%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;36-45 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 453 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18.3% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16.5%, 20.1%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;46-55 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 491 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19.8% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 18.0%, 21.7%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;56-65 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 490 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19.8% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 18.1%, 21.5%&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Apr 2021 18:49:01 GMT</pubDate>
    <dc:creator>Emma_at_SAS</dc:creator>
    <dc:date>2021-04-12T18:49:01Z</dc:date>
    <item>
      <title>Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733009#M228416</link>
      <description>&lt;P&gt;I want to use ODS OUTPUT to save the STATISTICS table from my PROC SURVEYMEAN procedure. However, the OUTPUT data contains different values than the STATISTICS table that I want to save. In this example, I want&amp;nbsp; &lt;CODE class=" language-sas"&gt;clm &lt;/CODE&gt;but I get only the&amp;nbsp;UpperCLMean. Thanks!&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
proc surveymeans data=sashelp.cars mean clm nobs plots = none; 
	var Horsepower;	
	run;
ods trace off;
ods output    Statistics=Output; 
proc surveymeans data=sashelp.cars mean clm nobs plots = none; 
	var Horsepower;	
	run;
proc print data=output; run;&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;Output Added:&lt;BR /&gt;-------------&lt;BR /&gt;Name: Summary&lt;BR /&gt;Label: Data Summary&lt;BR /&gt;Template: Stat.SurveyMeans.Factoid&lt;BR /&gt;Path: Surveymeans.Summary&lt;BR /&gt;-------------&lt;/P&gt;
&lt;P&gt;Output Added:&lt;BR /&gt;-------------&lt;BR /&gt;Name: Statistics&lt;BR /&gt;Label: Statistics&lt;BR /&gt;Template: Stat.SurveyMeans.Statistics&lt;BR /&gt;Path: Surveymeans.Statistics&lt;BR /&gt;-------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="systitleandfootercontainer" border="0" summary="Page Layout" width="100%" frame="void" rules="none" cellspacing="1" cellpadding="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c systemtitle"&gt;The SAS System&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;BR /&gt;
&lt;DIV class="c proctitle"&gt;The SURVEYMEANS Procedure&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Surveymeans: Data Summary" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="2" scope="colgroup"&gt;Data Summary&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Number of Observations&lt;/TH&gt;
&lt;TD class="r data"&gt;428&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A name="IDX1" target="_blank"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Surveymeans: Statistics" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="6" scope="colgroup"&gt;Statistics&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;N&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Mean&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Std Error&lt;BR /&gt;of Mean&lt;/TH&gt;
&lt;TH class="c b header" colspan="2" scope="colgroup"&gt;95% CL for Mean&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;Horsepower&lt;/TH&gt;
&lt;TD class="r data"&gt;428&lt;/TD&gt;
&lt;TD class="r data"&gt;215.89&lt;/TD&gt;
&lt;TD class="r data"&gt;3.5&lt;/TD&gt;
&lt;TD class="r data"&gt;209.06&lt;/TD&gt;
&lt;TD class="r data"&gt;222.71&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR size="3" /&gt;&lt;A name="IDX2" target="_blank"&gt;&lt;/A&gt;
&lt;TABLE class="systitleandfootercontainer" border="0" summary="Page Layout" width="100%" frame="void" rules="none" cellspacing="1" cellpadding="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c systemtitle"&gt;The SAS System&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.OUTPUT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;VarName&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Mean&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;LowerCLMean&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;N&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;StdErr&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;UpperCLMean&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Horsepower&lt;/TD&gt;
&lt;TD class="r data"&gt;215.89&lt;/TD&gt;
&lt;TD class="r data"&gt;209.06&lt;/TD&gt;
&lt;TD class="r data"&gt;428&lt;/TD&gt;
&lt;TD class="r data"&gt;3.5&lt;/TD&gt;
&lt;TD class="r data"&gt;222.71&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Apr 2021 14:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733009#M228416</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T14:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733010#M228417</link>
      <description>&lt;P&gt;I noticed the columns are all there, and I need to change the order for the columns!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 14:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733010#M228417</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T14:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733021#M228419</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84351"&gt;@Emma_at_SAS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the RETAIN statement to rearrange the variables. For example, to obtain the order&amp;nbsp;&lt;FONT face="courier new,courier"&gt;VarName N Mean StdErr LowerCLMean UpperCLMean&lt;/FONT&gt;, use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data output(label='Statistics');
retain VarName N Mean StdErr;
set output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you don't need to maintain the original dataset label, just omit the LABEL= dataset option as shown in the step below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can use multiple SET statements in conjunction with selective KEEP= or DROP= dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data output;
set output(keep=v: n);
set output(keep=m: s:);
set output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you don't need to write out the variable names.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 15:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733021#M228419</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-04-12T15:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733031#M228420</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;A class="trigger-hovercard" style="font-family: inherit; background-color: #ffffff;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733" target="_blank"&gt;FreelanceReinhard!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;RETAIN statement&amp;nbsp;works very well! I wonder how I may remove the OBS column? I want to use this data in a report and I am creating many tables for different variables. I do not want to remove the OBS column manually but &lt;STRONG&gt;OBS&lt;/STRONG&gt; is not a real column and I cannot DROP it. Any suggestions would be appreciated!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, how may I add a column for the name of the variable in my SAS dataset. For example, age is called age_in_years. How may I add a column called &lt;STRONG&gt;var_name&lt;/STRONG&gt; and the observation for that would be &lt;STRONG&gt;age_in_years&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.OUTPUT_AGE" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;VarName&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;VarLabel&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;N&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Mean&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;AGE_StdDev&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;LowerCLMean&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;UpperCLMean&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TH&gt;
&lt;TD class="l data"&gt;AGE&lt;/TD&gt;
&lt;TD class="l data"&gt;AGE: How old are you today?&lt;/TD&gt;
&lt;TD class="r data"&gt;2400&lt;/TD&gt;
&lt;TD class="r data"&gt;15.12&lt;/TD&gt;
&lt;TD class="r data"&gt;3.57&lt;/TD&gt;
&lt;TD class="r data"&gt;2.61&lt;/TD&gt;
&lt;TD class="r data"&gt;4.18&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Apr 2021 15:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733031#M228420</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T15:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733032#M228421</link>
      <description>&lt;P&gt;Add the NOOBS option to the PROC PRINT statement.&lt;/P&gt;
&lt;P&gt;You could also just add a VAR statement to the PROC PRINT step to change the order they are printed without having to add a step to re-order the variables in the dataset.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 16:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733032#M228421</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-12T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733033#M228422</link>
      <description>&lt;P&gt;&lt;SPAN&gt;how may I add a column for the name of the variable in my SAS dataset. For example, age is called age_in_years. How may I add a column called&amp;nbsp;&lt;STRONG&gt;sas_&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;var_name&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and the observation for that would be&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;age_in_years&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 16:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733033#M228422</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T16:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733034#M228423</link>
      <description>Thank you, Tom!</description>
      <pubDate>Mon, 12 Apr 2021 16:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733034#M228423</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T16:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733043#M228427</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84351"&gt;@Emma_at_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you,&amp;nbsp;&lt;A class="trigger-hovercard" style="font-family: inherit; background-color: #ffffff;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733" target="_blank" rel="noopener"&gt;FreelanceReinhard!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;RETAIN statement&amp;nbsp;works very well! I wonder how I may remove the OBS column? I want to use this data in a report and I am creating many tables for different variables. I do not want to remove the OBS column manually but &lt;STRONG&gt;OBS&lt;/STRONG&gt; is not a real column and I cannot DROP it. Any suggestions would be appreciated!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, how may I add a column for the name of the variable in my SAS dataset. For example, age is called age_in_years. How may I add a column called &lt;STRONG&gt;var_name&lt;/STRONG&gt; and the observation for that would be &lt;STRONG&gt;age_in_years&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where would this (other) "&lt;SPAN&gt;name of the variable" come from? Normally such longer descriptions of a variable are stored in its&amp;nbsp;&lt;EM&gt;label&lt;/EM&gt;, which is included as variable &lt;FONT face="courier new,courier"&gt;VarLabel&lt;/FONT&gt;&amp;nbsp;in the ODS output dataset, as shown in your output and in the example below (using the NOOBS option and the VAR statement of PROC PRINT as suggested by&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159" target="_blank" rel="noopener"&gt;Tom&lt;/A&gt;).&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output Statistics=Output;
proc surveymeans data=sashelp.cars mean clm nobs plots = none;
var EngineSize; 
run;

proc print data=output noobs;
var v: n m: s: l: u:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;PROC PRINT output:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;                                                                                      Lower         Upper
 VarName         VarLabel                   N            Mean          StdErr        CLMean        CLMean

EngineSize    Engine Size (L)             428        3.196729        0.053586    3.09140391    3.30205404&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 17:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733043#M228427</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-04-12T17:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733045#M228428</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84351"&gt;@Emma_at_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you,&amp;nbsp;&lt;A class="trigger-hovercard" style="font-family: inherit; background-color: #ffffff;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733" target="_blank" rel="noopener"&gt;FreelanceReinhard!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;RETAIN statement&amp;nbsp;works very well! I wonder how I may remove the OBS column? I want to use this data in a report and I am creating many tables for different variables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.OUTPUT_AGE" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What kind of "report" are you creating? All of the typical SAS report procedures, Print, Report and Tabulate allow you to control which variables appear at all, labels and lots of other things. So just don't include OBS in the syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or if you are being lazy for code you can tell any specific procedure to ignore specific variables for that step using a data set option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc print data=sashelp.class (drop=Age);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example. Uses the default Print behavior of printing "everything" but since the variable has been dropped from the Procedure the Age does not appear. The data set is not modified permanently though.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 17:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733045#M228428</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-12T17:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733069#M228443</link>
      <description>&lt;P&gt;Thank you, Tom, for your explanation!&lt;/P&gt;
&lt;P&gt;I have a large data set with a mix of continuous and categorical variables. For the first round of conversation among our team, I am preparing summary tables for our&amp;nbsp;continuous and categorical variables. I copied the example tables below for the age of the participants as AGE_IN_YEARS and the age category of parents as&amp;nbsp;AGE_GROUPS_PARENTS. Among the options you mentioned, I am using proc print. Basically, I save the output results in the output datasets:&lt;/P&gt;
&lt;P&gt;ods output Summary=Output; for the continuous variables&lt;/P&gt;
&lt;P&gt;ods output OneWay=Output; for the categorical variables&lt;/P&gt;
&lt;P&gt;Then, use PROC PRINT to print the Output dataset in a Word file.&lt;/P&gt;
&lt;P&gt;I am working to make a MACRO to avoid repetition. I would love to know if there is an easier way to do this.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;Age [AGE_IN_YEARS]&amp;nbsp;How old are you today? (years)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Mean&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12.25&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Standard Deviation 1.17&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;95% CI&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13.61%, 14.18%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;N&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2500&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;Age category of parents [AGE_GROUPS_PARENTS]&amp;nbsp;Age in categories. (years)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Frequency&amp;nbsp; Percent&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 95% CI&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt;16-25 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 515 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20.8%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18.2%, 23.4%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;26-35 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 526 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21.3%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19.1%, 23.4%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;36-45 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 453 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18.3% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16.5%, 20.1%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;46-55 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 491 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19.8% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 18.0%, 21.7%&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800080"&gt;56-65 years&amp;nbsp; &amp;nbsp; &amp;nbsp; 490 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;19.8% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 18.1%, 21.5%&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 18:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733069#M228443</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T18:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Customize ODS OUTPUT to create the Statistics table from a specific procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733071#M228444</link>
      <description>ballardw, In this post to Tom I meant you! Sorry, about that! I do not see an option to edit that in my post!&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 12 Apr 2021 18:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Customize-ODS-OUTPUT-to-create-the-Statistics-table-from-a/m-p/733071#M228444</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-04-12T18:51:08Z</dc:date>
    </item>
  </channel>
</rss>

