<?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: Is there a way to round the output from proc tabulate to the nearest 100? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149024#M39368</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those looking for more details about how to use a custom function in a SAS format definition, see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03gl338avbj.htm" title="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03gl338avbj.htm"&gt;Base SAS(R) 9.4 Procedures Guide, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also Rick Langston's paper from SAS Global Forum 2012:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="https://support.sas.com/resources/papers/proceedings12/245-2012.pdf" title="Using the New Features in PROC FORMAT"&gt;Using the New Features in PROC FORMAT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 14:19:21 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2014-08-14T14:19:21Z</dc:date>
    <item>
      <title>Is there a way to round the output from proc tabulate to the nearest 100?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149019#M39363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if anyone knows of a way to display the output from proc tabulate to the nearest 100, or a format that I could apply?&amp;nbsp; At the moment, I'm outputting to an excel spreadsheet and using the rounding function in excel, but it's pretty tedious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celia.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 05:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149019#M39363</guid>
      <dc:creator>Celia</dc:creator>
      <dc:date>2014-08-05T05:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to round the output from proc tabulate to the nearest 100?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149020#M39364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create a picture format with the round option and use that in the respective table definition.&lt;/P&gt;&lt;P&gt;An example is given in this document: &lt;A href="http://www2.sas.com/proceedings/sugi30/243-30.pdf" title="http://www2.sas.com/proceedings/sugi30/243-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/243-30.pdf&lt;/A&gt; (search for "round")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 07:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149020#M39364</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-08-05T07:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to round the output from proc tabulate to the nearest 100?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149021#M39365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Celia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC FORMAT allows you to create your own format to do this.&lt;/P&gt;&lt;P&gt;The PICTURE statenent supports a multiplier which you could set as MULT= .01 to achieve that "divide by 100" and a ROUND option to complete the objective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;proc format ;&lt;/P&gt;&lt;P&gt; picture hundth (round)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; low-high = '0,000,009'(mult=.01) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use it in a tabulate table like&lt;/P&gt;&lt;P&gt;table ( rowclass all),( columnclass all)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *analysisVar*sum=' '*f= HUNDTH. ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck&lt;/P&gt;&lt;P&gt;peterC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 07:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149021#M39365</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-08-05T07:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to round the output from proc tabulate to the nearest 100?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149022#M39366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can take advantage that with SAS9.4 we can create formats, that use functions to return the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is an example:&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;*&lt;BR /&gt;* create a function to round &lt;BR /&gt;*;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;fcmp&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;outlib&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=work.func.sample;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; xround100(value);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;( round(value, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;100&lt;/STRONG&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; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;endsub&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;*&lt;BR /&gt;* make function available&lt;BR /&gt;*;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;options&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cmplib&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=work.func;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;*&lt;BR /&gt;* create a format that uses the function&lt;BR /&gt;*;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;format&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; xround100x&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; low - high = [xround100()]&lt;BR /&gt;&amp;nbsp; ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;*&lt;BR /&gt;* apply the format&lt;BR /&gt;*;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;tabulate&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=sashelp.cars;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; origin type;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; invoice;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; type, origin*invoice*f=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;xround100x.&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; type, origin*invoice;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 08:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149022#M39366</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2014-08-05T08:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to round the output from proc tabulate to the nearest 100?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149023#M39367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Peter.C,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives me the right results. eg. if the number was 722, the output gives me 7.&amp;nbsp; Is there a way to make the output 700 rather than 7?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celia.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Aug 2014 22:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149023#M39367</guid>
      <dc:creator>Celia</dc:creator>
      <dc:date>2014-08-10T22:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to round the output from proc tabulate to the nearest 100?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149024#M39368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those looking for more details about how to use a custom function in a SAS format definition, see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03gl338avbj.htm" title="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03gl338avbj.htm"&gt;Base SAS(R) 9.4 Procedures Guide, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also Rick Langston's paper from SAS Global Forum 2012:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="https://support.sas.com/resources/papers/proceedings12/245-2012.pdf" title="Using the New Features in PROC FORMAT"&gt;Using the New Features in PROC FORMAT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-a-way-to-round-the-output-from-proc-tabulate-to-the/m-p/149024#M39368</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2014-08-14T14:19:21Z</dc:date>
    </item>
  </channel>
</rss>

