<?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: Formatting results of Proc Means without using ODS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197172#M49264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use another procedure that will allow specific formats for variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var my_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tables mydate, max*f=date9. min*f=mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2015 17:26:39 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-08-13T17:26:39Z</dc:date>
    <item>
      <title>Formatting results of Proc Means without using ODS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197170#M49262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;Wondering if anyone's figure out a way to format output of proc means (or other similar procedures) without using the ODS option. There are times when you just want to throw in a format statement and want to see results in a user-friendly format but it seems its not as straightforward as it sounds.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;For example, let's say I wanted to get the smallest and largest date from the last-created dataset. Since the dates are stored in numeric (SAS date) format, I'd want to add on a format statement so I can actually see what those dates are. Something similar to this code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="line-height: 1.5em; color: #000080; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc means MIN MAX;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp; format MY_DATE DATE9.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp; var MY_DATE;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I get is this:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #003366;"&gt;Minimum Maximum&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #003366;"&gt;&amp;nbsp; ----------------------------&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #003366;"&gt;&amp;nbsp; 20090.00 20310.00&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #003366;"&gt;&amp;nbsp; ----------------------------&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;I've tried placing the format statement both BEFORE and AFTER the var statement but haven't had luck. It seems the format statement is ignored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;Of course, I could use options like an output statement or ODS etc. etc. which seem to trigger the format statement but my whole point is why do any extra work unless its absolutely required.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 20:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197170#M49262</guid>
      <dc:creator>BecomingSASsy</dc:creator>
      <dc:date>2015-08-11T20:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting results of Proc Means without using ODS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197171#M49263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I once tried using PROC MEANS to do this but gave it up.&amp;nbsp; I've found PROC SQL is better suited for this type of task, IMO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; Stock, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (MIN(Date)) FORMAT=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;mmddyy10.&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; MIN_of_Date, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (MAX(Date)) FORMAT=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;DATE.&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; MAX_of_Date&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; SASHELP.STOCKS&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 17:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197171#M49263</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2015-08-13T17:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting results of Proc Means without using ODS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197172#M49264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use another procedure that will allow specific formats for variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var my_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tables mydate, max*f=date9. min*f=mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 17:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197172#M49264</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-13T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting results of Proc Means without using ODS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197173#M49265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right @PhilC. I've turned to proc sql myself in similar situations, which works well if you have a few variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SQL requires a format statement for each variable, whereas if the format statement worked in proc means, you could do something like this, for example:&lt;/P&gt;&lt;P&gt;format var1-varN comma12.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;So the benefit of having a format statement in proc means would be if you had multiple variables that you wanted to apply the same format to, you could save some typing.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 19:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-results-of-Proc-Means-without-using-ODS/m-p/197173#M49265</guid>
      <dc:creator>BecomingSASsy</dc:creator>
      <dc:date>2015-08-17T19:38:28Z</dc:date>
    </item>
  </channel>
</rss>

