<?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 User-Defined Numeric Formats in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125318#M10560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to define a format that keeps a variable as numeric type but displays a character string much like the dollar&lt;EM&gt;w.d&lt;/EM&gt; or percent&lt;EM&gt;w.d&lt;/EM&gt; format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if the value stored is "1234.56" but is linked to format dollar7.2, then the value will appear as "$1,234.56" (technically a character string due to '$' and ',' but still numeric).&amp;nbsp; Or if the value stored is "0.1234" and is linked to format percent9.1, then the value will appear as "12.3%" (technically a character string due to '%' but still numeric).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if I have a numeric valued stored as "1.23" with a user-defined format, can I make it appear as "1.23 mg/m2" and still retain the numeric properties?&amp;nbsp; I used to create a character variable by using:&amp;nbsp; &lt;STRONG&gt;charvar=compress(numvar) || ' mg/m2';&lt;/STRONG&gt; but I&amp;nbsp; want to retain the properties of a numeric variable so I can sort numerically and/or summarize the data while automatically displaying any units that should be attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2012 20:00:34 GMT</pubDate>
    <dc:creator>djbateman</dc:creator>
    <dc:date>2012-11-13T20:00:34Z</dc:date>
    <item>
      <title>User-Defined Numeric Formats</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125318#M10560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to define a format that keeps a variable as numeric type but displays a character string much like the dollar&lt;EM&gt;w.d&lt;/EM&gt; or percent&lt;EM&gt;w.d&lt;/EM&gt; format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if the value stored is "1234.56" but is linked to format dollar7.2, then the value will appear as "$1,234.56" (technically a character string due to '$' and ',' but still numeric).&amp;nbsp; Or if the value stored is "0.1234" and is linked to format percent9.1, then the value will appear as "12.3%" (technically a character string due to '%' but still numeric).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if I have a numeric valued stored as "1.23" with a user-defined format, can I make it appear as "1.23 mg/m2" and still retain the numeric properties?&amp;nbsp; I used to create a character variable by using:&amp;nbsp; &lt;STRONG&gt;charvar=compress(numvar) || ' mg/m2';&lt;/STRONG&gt; but I&amp;nbsp; want to retain the properties of a numeric variable so I can sort numerically and/or summarize the data while automatically displaying any units that should be attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 20:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125318#M10560</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2012-11-13T20:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: User-Defined Numeric Formats</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125319#M10561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could always create a picture format.&amp;nbsp; Take a look at: &lt;A href="http://www2.sas.com/proceedings/sugi31/243-31.pdf" title="http://www2.sas.com/proceedings/sugi31/243-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/243-31.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 20:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125319#M10561</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-13T20:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: User-Defined Numeric Formats</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125320#M10562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I knew there would be something simple in PROC FORMAT, but I wasn't finding it.&amp;nbsp; This did the trick.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 20:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125320#M10562</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2012-11-13T20:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: User-Defined Numeric Formats</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125321#M10563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Picture formats let you do such things as add suffix or prefixes to numbers using a combination of digit selectors and directives. The example below comes close. Use of 'mg/m2' treats the 2 as a digit selector and replaces the 2 with a 0, or possibly another digit depending on range of the numeric involved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc format library=work; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;picture mg &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;low-high = '000009.99 mg/msq'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=1.23; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put x mg.; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 20:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/User-Defined-Numeric-Formats/m-p/125321#M10563</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-11-13T20:11:31Z</dc:date>
    </item>
  </channel>
</rss>

