<?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: dollar format: not define the w? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18091#M3508</link>
    <description>Hi:&lt;BR /&gt;
  If you just used the format (for the AMOUNT variable) like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
format amount dollar.;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
You'd probably see this note in the SAS log:&lt;BR /&gt;
[pre]&lt;BR /&gt;
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST"&lt;BR /&gt;
      format.&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
This might result in something like 'E' notation or scientific notation (1.23E8) being used. However, there's no problem in just specifying a large width. Only the LISTING destination uses the WIDTH for the output. ODS destinations just use the widest column for output reports. Consider the program below.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data numbers;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input name $ amount;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
alan 1.00&lt;BR /&gt;
barb 123456789.22&lt;BR /&gt;
carl 2345.33&lt;BR /&gt;
dana 345.44&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                  &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\usebigdollar.html' style=sasweb;&lt;BR /&gt;
  proc print data=numbers;&lt;BR /&gt;
    title 'Note that the table cell for amount does not use the "extra" width of the format';&lt;BR /&gt;
    sum amount;&lt;BR /&gt;
    var name amount;&lt;BR /&gt;
    format amount dollar24.;&lt;BR /&gt;
  run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Sat, 26 Feb 2011 19:42:24 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-02-26T19:42:24Z</dc:date>
    <item>
      <title>dollar format: not define the w?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18090#M3507</link>
      <description>Experts:&lt;BR /&gt;
Is it possible to tell SAS to format a numeric value in dollar format without having to specify the w? Sometimes all I want to make sure is to limit the decimal points. If the format is for a cumulative variable (e.g. total payments from a large number of customers), I'm hoping to avoid the trouble of estimating how large the total will be to make sure dollar w.d has enough width. &lt;BR /&gt;
Thank you!</description>
      <pubDate>Sat, 26 Feb 2011 18:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18090#M3507</guid>
      <dc:creator>mnew</dc:creator>
      <dc:date>2011-02-26T18:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: dollar format: not define the w?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18091#M3508</link>
      <description>Hi:&lt;BR /&gt;
  If you just used the format (for the AMOUNT variable) like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
format amount dollar.;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
You'd probably see this note in the SAS log:&lt;BR /&gt;
[pre]&lt;BR /&gt;
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST"&lt;BR /&gt;
      format.&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
This might result in something like 'E' notation or scientific notation (1.23E8) being used. However, there's no problem in just specifying a large width. Only the LISTING destination uses the WIDTH for the output. ODS destinations just use the widest column for output reports. Consider the program below.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data numbers;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input name $ amount;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
alan 1.00&lt;BR /&gt;
barb 123456789.22&lt;BR /&gt;
carl 2345.33&lt;BR /&gt;
dana 345.44&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                  &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\usebigdollar.html' style=sasweb;&lt;BR /&gt;
  proc print data=numbers;&lt;BR /&gt;
    title 'Note that the table cell for amount does not use the "extra" width of the format';&lt;BR /&gt;
    sum amount;&lt;BR /&gt;
    var name amount;&lt;BR /&gt;
    format amount dollar24.;&lt;BR /&gt;
  run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Sat, 26 Feb 2011 19:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18091#M3508</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-26T19:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: dollar format: not define the w?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18092#M3509</link>
      <description>Thank you for the details, Cynthia. I also forgot that format has nothing to do with storage so it does not hurt to define a large one.</description>
      <pubDate>Tue, 01 Mar 2011 00:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/dollar-format-not-define-the-w/m-p/18092#M3509</guid>
      <dc:creator>mnew</dc:creator>
      <dc:date>2011-03-01T00:52:34Z</dc:date>
    </item>
  </channel>
</rss>

