<?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: Negative sign before Dollar Sign - Dollar Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582957#M165896</link>
    <description>&lt;P&gt;1. Change so that the default length will show the $&lt;/P&gt;
&lt;P&gt;2. Change so that the other format is default dollar format for values above 0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
picture mycurrencyfmt (default =22 )
low - 0 = '000,000,099.99' (prefix = '-$')
other = [dollar22.] ;

run;

data demo;
input value;
format value mycurrencyfmt.;
cards;
25
45
3993
34343434314
-3434343
-234
-2334
-34343413413413.23
;;;;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213838"&gt;@new_sas_user_4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, this is what I ran:&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;picture myCurrencyFmt&lt;BR /&gt;low - 0 = '999,999,999.99' (prefix = '-$')&lt;BR /&gt;0 - high = '999,999,999.99' (prefix = '$');&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;A=-10.1;&lt;BR /&gt;putlog A=myCurrencyFmt.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got&amp;nbsp;A=000,000,010.10 in the log!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2019 19:23:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-08-21T19:23:20Z</dc:date>
    <item>
      <title>Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582505#M165690</link>
      <description>&lt;P&gt;I am using dollar12. format in my proc report and for the negative values I get the negative sign "-" after the dollar sign ($-10)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, I would want the negative sign to be before the dollar sign (-$10)&lt;/P&gt;&lt;P&gt;Is there a way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;A=-10.1;&lt;BR /&gt;putlog A= dollar12. ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 18:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582505#M165690</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2019-08-20T18:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582515#M165692</link>
      <description>&lt;P&gt;I think you need a custom format.&lt;/P&gt;
&lt;P&gt;Untested but something like this I assume, untested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture myCurrencyFmt
   low - 0 = '999,999,999.99' (prefix = '-$')
   0 - high = '999,999,999.99' (prefix = '$');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213838"&gt;@new_sas_user_4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am using dollar12. format in my proc report and for the negative values I get the negative sign "-" after the dollar sign ($-10)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, I would want the negative sign to be before the dollar sign (-$10)&lt;/P&gt;
&lt;P&gt;Is there a way to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;A=-10.1;&lt;BR /&gt;putlog A= dollar12. ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks !!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 18:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582515#M165692</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-20T18:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582795#M165836</link>
      <description>&lt;P&gt;Using the below I get :&amp;nbsp;NOTE: Variable myCurrencyFmt is uninitialized.&lt;BR /&gt;A=-10.1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;picture myCurrencyFmt&lt;BR /&gt;low - 0 = '999,999,999.99' (prefix = '-$')&lt;BR /&gt;0 - high = '999,999,999.99' (prefix = '$');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;A=-10.1;&lt;BR /&gt;putlog A=myCurrencyFmt ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 14:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582795#M165836</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2019-08-21T14:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582840#M165849</link>
      <description>You forgot the period after the format name in your code so it's trying to find a variable with that name.</description>
      <pubDate>Wed, 21 Aug 2019 14:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582840#M165849</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-21T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582948#M165892</link>
      <description>&lt;P&gt;thanks Reeza.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see&amp;nbsp;A=000,000,010.10 in the log now!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this using SAS formats ?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582948#M165892</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2019-08-21T19:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582949#M165893</link>
      <description>&lt;P&gt;That is a format - note PROC FORMAT. Did you remember the prefix portion, why isn't that showing?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213838"&gt;@new_sas_user_4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;thanks Reeza.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see&amp;nbsp;A=000,000,010.10 in the log now!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to do this using SAS formats ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582949#M165893</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-21T19:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582953#M165895</link>
      <description>&lt;P&gt;Yes, this is what I ran:&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;picture myCurrencyFmt&lt;BR /&gt;low - 0 = '999,999,999.99' (prefix = '-$')&lt;BR /&gt;0 - high = '999,999,999.99' (prefix = '$');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;A=-10.1;&lt;BR /&gt;putlog A=myCurrencyFmt.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got&amp;nbsp;A=000,000,010.10 in the log!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582953#M165895</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2019-08-21T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582957#M165896</link>
      <description>&lt;P&gt;1. Change so that the default length will show the $&lt;/P&gt;
&lt;P&gt;2. Change so that the other format is default dollar format for values above 0.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
picture mycurrencyfmt (default =22 )
low - 0 = '000,000,099.99' (prefix = '-$')
other = [dollar22.] ;

run;

data demo;
input value;
format value mycurrencyfmt.;
cards;
25
45
3993
34343434314
-3434343
-234
-2334
-34343413413413.23
;;;;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213838"&gt;@new_sas_user_4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, this is what I ran:&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;picture myCurrencyFmt&lt;BR /&gt;low - 0 = '999,999,999.99' (prefix = '-$')&lt;BR /&gt;0 - high = '999,999,999.99' (prefix = '$');&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;A=-10.1;&lt;BR /&gt;putlog A=myCurrencyFmt.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got&amp;nbsp;A=000,000,010.10 in the log!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/582957#M165896</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-21T19:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Negative sign before Dollar Sign - Dollar Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/583227#M166017</link>
      <description>&lt;P&gt;Awesome!!&lt;/P&gt;&lt;P&gt;Thanks!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 15:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-sign-before-Dollar-Sign-Dollar-Format/m-p/583227#M166017</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2019-08-22T15:24:42Z</dc:date>
    </item>
  </channel>
</rss>

