<?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: Displaying dollar sign in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713536#M27176</link>
    <description>&lt;P&gt;I would suggest using option stackods. Example :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc  means data=sashelp.shoes stackods;
class region;
var sales;
ods output summary=sumry;
run;

ods rtf file="/home/pg/SASforum/rtgtest.rtf" style=journal;
proc print data=sumry;
format n 5.0 mean min max dollar11.2;
var n min mean max;
id region;
run; 
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1611360813400.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53818i14E61C77F037FA61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PGStats_0-1611360813400.png" alt="PGStats_0-1611360813400.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jan 2021 00:13:58 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2021-01-23T00:13:58Z</dc:date>
    <item>
      <title>Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713508#M27169</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am new to SAS I am trying to display the dollar sign for the 'sales' variable in the report when it prints.&amp;nbsp;&lt;BR /&gt;I have tried doing this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var Sales dollar10.2 Inventory Returns&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work.&lt;/P&gt;&lt;P&gt;Any help will be appreciated. See my code below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*******************************************************************&lt;/P&gt;&lt;P&gt;data derive.shoes_stats;&lt;BR /&gt;set shoes_stats;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data = derive.shoes_stats;&lt;BR /&gt;by region;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods rtf file='C:\Users\18483\Documents\SAS Training\Studies\Clinical\Data\output\shoes_region.rtf';&lt;BR /&gt;title 'Table 1: Summary Statistics of Shoes By Region';&lt;BR /&gt;proc means data = derive.shoes_stats;&lt;BR /&gt;class region;&lt;BR /&gt;var Sales Inventory Returns;&lt;BR /&gt;run;&lt;BR /&gt;ods rtf close;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 22:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713508#M27169</guid>
      <dc:creator>nduksy</dc:creator>
      <dc:date>2021-01-22T22:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713510#M27170</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;... but it doesn't work&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realize you are new, so this ought to help you get faster responses in the future. Saying it doesn't work, but not giving us any additional information, will always result in a follow up question. We can't know what happened or why it doesn't work if that's all you tell us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, when something doesn't work, save yourself some time and please show us the incorrect output &lt;STRONG&gt;AND/OR&lt;/STRONG&gt; the LOG from SAS &lt;STRONG&gt;AND/OR&lt;/STRONG&gt; an explanation of what did happen and why it way wrong. If you are going to show us the LOG, please copy it as text and paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon, this will format the LOG properly and make it more readable (and I don't try to read improperly formatted LOGs any more).&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 22:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713510#M27170</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-22T22:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713512#M27171</link>
      <description>&lt;P&gt;Thanks for the heads up. My code runs without errors and outputs the expected results to the .rtf file, but when I add this line:&amp;nbsp;var Sales dollar10.2 Inventory Returns;&lt;/P&gt;&lt;P&gt;I get the error below and a blank .rtf file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;5887  ods rtf file='C:\Users\18483\Documents\SAS Training\Studies\Clinical\Data\output\shoes_region.rtf';
NOTE: Writing RTF Body file: C:\Users\18483\Documents\SAS Training\Studies\Clinical\Data\output\shoes_region.rtf
5888  title 'Table 1: Summary Statistics of Shoes By Region';
5889  proc means data = derive.shoes_stats;
5890  class region;
5891  var Sales dollar10.2 Inventory Returns;
                ----------
                22
                201
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.
ERROR 201-322: The option is not recognized and will be ignored.
5892  run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 22:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713512#M27171</guid>
      <dc:creator>nduksy</dc:creator>
      <dc:date>2021-01-22T22:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713514#M27172</link>
      <description>&lt;P&gt;In short, saying "it doesn't work" doesn't work.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 22:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713514#M27172</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-01-22T22:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713519#M27173</link>
      <description>&lt;P&gt;I don't see where you attempt to use the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Means does not format statistics. And since one of the default statistics is N it would not make sense to have $35 for the N of Sales.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So either use&amp;nbsp; proc means to create a data set and then apply the formats to appropriate variables with proc print or use a different procedure like proc report or proc tabulate where you can specify the format with the specific statistic as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;proc means data = derive.shoes_stats noprint nway;
   class region;
   var Sales Inventory Returns;
   output out=work.summary (drop=_:) 
       n= min= mean= max= std= /autoname
   ;
run;
Proc print data=work.summary noobs;
   var Sales_n Sales_min Sales_mean Sales_max;
   format Sales_min Sales_mean Sales_max Dollar10.2;
run;&lt;/PRE&gt;
&lt;P&gt;one way. Others depending on what the result really needs to look like.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 23:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713519#M27173</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-22T23:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713524#M27174</link>
      <description>You put the format in the VAR statement, it belongs in a FORMAT statement. They're entirely separate. The ATTRIB statement allows you to combine setting different attributes in a single statement if you want to do something like that. VAR statements control what variables are displayed in the PROC.</description>
      <pubDate>Fri, 22 Jan 2021 23:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713524#M27174</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-22T23:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying dollar sign</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713536#M27176</link>
      <description>&lt;P&gt;I would suggest using option stackods. Example :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc  means data=sashelp.shoes stackods;
class region;
var sales;
ods output summary=sumry;
run;

ods rtf file="/home/pg/SASforum/rtgtest.rtf" style=journal;
proc print data=sumry;
format n 5.0 mean min max dollar11.2;
var n min mean max;
id region;
run; 
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1611360813400.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53818i14E61C77F037FA61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PGStats_0-1611360813400.png" alt="PGStats_0-1611360813400.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 00:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Displaying-dollar-sign/m-p/713536#M27176</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-01-23T00:13:58Z</dc:date>
    </item>
  </channel>
</rss>

