<?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: Million Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440162#M109911</link>
    <description>&lt;P&gt;Just tinker around with the mult factors and the number of decimal places, represented by the format characters 0 or 9:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture million (round fuzz=0)
  0 -&amp;lt; 1000000 = '9.000' (prefix='' mult=0.001)
  1000000 - high ='0000.0' (prefix='' mult=.00001)
;
run;

data test;
input x;
format x million. ;
cards;
1200000
230700000
1000
49000
;
run;

title;
proc print noobs;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 12:13:13 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-02-26T12:13:13Z</dc:date>
    <item>
      <title>Million Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440121#M109897</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to create million format.&lt;/P&gt;&lt;P&gt;Please look at this example&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;picture million (round fuzz=0)&lt;BR /&gt;0 -&amp;lt; 50000 = '00.0' (prefix='' mult=0.0)&lt;BR /&gt;50000 -&amp;lt; 1000000 = '00.0' (prefix='' mult=0.00001)&lt;BR /&gt;1000000 -&amp;lt; 1000000000='0000.0' (prefix='' mult=.00001);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data tbl1 ;&lt;BR /&gt;x = 1200000;&lt;BR /&gt;y = 230700000;&lt;BR /&gt;z=1000;&lt;BR /&gt;format _all_ million. ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;title;&lt;BR /&gt;proc print noobs;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the print we can see that value of z is null &amp;nbsp;but we need to see value of 0.1.&lt;/P&gt;&lt;P&gt;What is the siolution and why did it happen?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question: I saw in internet using statment : &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; put (_all_)(=million.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is it doing ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ron&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 06:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440121#M109897</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-02-26T06:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Million Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440133#M109900</link>
      <description>&lt;P&gt;First of all, a mult factor of 0.0 will automatically set everything to zero.&lt;/P&gt;
&lt;P&gt;Second, you need to force the display of a leading zero before the dot by using '9' instead of '0':&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture million (round fuzz=0)
0 -&amp;lt; 50000 = '09.0' (prefix='' mult=0.001)
50000 -&amp;lt; 1000000 = '00.0' (prefix='' mult=0.00001)
1000000 -&amp;lt; 1000000000='0000.0' (prefix='' mult=.00001);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you run that with your other code, you get this result:&lt;/P&gt;
&lt;PRE&gt; x       y       z

1.2    230.7    0.1
&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 08:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440133#M109900</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-02-26T08:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Million Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440160#M109909</link>
      <description>Thank you&lt;BR /&gt;If we add another value than after proc print we are getting an error value&lt;BR /&gt;Please look what I need&lt;BR /&gt;ActualValue_In_USD&lt;BR /&gt;1,200,000&lt;BR /&gt;230,700,000&lt;BR /&gt;1,000&lt;BR /&gt;49,000&lt;BR /&gt;Desired Values In Millions&lt;BR /&gt;1.2&lt;BR /&gt;230.7&lt;BR /&gt;0.001&lt;BR /&gt;0.049&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IF you run this code then you get for W value 4.9 but it is not&lt;BR /&gt;correct and need to be 0.049&lt;BR /&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;picture million (round fuzz=0)&lt;BR /&gt;0 -&amp;lt; 50000 = '09.0' (prefix='' mult=0.001)&lt;BR /&gt;50000 -&amp;lt; 1000000 = '00.0' (prefix='' mult=0.00001)&lt;BR /&gt;1000000 -&amp;lt; 1000000000='0000.0' (prefix='' mult=.00001);&lt;BR /&gt;run;&lt;BR /&gt;data tbl1 ;&lt;BR /&gt;x = 1200000;&lt;BR /&gt;y = 230700000;&lt;BR /&gt;z=1000;&lt;BR /&gt;w=49000;&lt;BR /&gt;format _all_ million. ;&lt;BR /&gt;run;&lt;BR /&gt;title;&lt;BR /&gt;proc print noobs;run;</description>
      <pubDate>Mon, 26 Feb 2018 12:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440160#M109909</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-02-26T12:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Million Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440162#M109911</link>
      <description>&lt;P&gt;Just tinker around with the mult factors and the number of decimal places, represented by the format characters 0 or 9:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture million (round fuzz=0)
  0 -&amp;lt; 1000000 = '9.000' (prefix='' mult=0.001)
  1000000 - high ='0000.0' (prefix='' mult=.00001)
;
run;

data test;
input x;
format x million. ;
cards;
1200000
230700000
1000
49000
;
run;

title;
proc print noobs;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 12:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440162#M109911</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-02-26T12:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Million Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440168#M109912</link>
      <description>&lt;P&gt;Here's another approach that applies the "social media" rounding format: "k" for thousands, "M" for millions, etc.&amp;nbsp; I &lt;A href="https://blogs.sas.com/content/sasdummy/2014/08/13/social-media-counts-formats/" target="_self"&gt;described it in this blog post&lt;/A&gt;.&amp;nbsp; Example code here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Format your numbers like a social media superstar      */
/* Provided for example purposes only by Chris Hemedinger */
libname library (work);
proc format lib=library;
  value linkedin    
	500 - high ='500+'
	;
run;

data followers;
  length name $ 40 followers 8 displayed 8;
  format displayed linkedin.;
  infile datalines dsd;
  input name followers;
  displayed = followers;
datalines;
Chris Hemedinger, 776
Kevin Bacon, 100543
Norman Newbie, 3
Colleen Connector, 499
;
run;


proc format lib=library;
picture social (round)
 1E03-&amp;lt;1000000='000K' (mult=.001  )
 1E06-&amp;lt;1000000000='000.9M' (mult=.00001)
 1E09-&amp;lt;1000000000000='000.9B' (mult=1E-08)
 1E12-&amp;lt;1000000000000000='000.9T' (mult=1E-11);
run;

/* test data */ 
data likes (keep=actual displayed);
format actual comma20.
 displayed social.;
 do i=1 to 12;
  actual=16**i;
  displayed = actual;
  output;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="socialcount_output (1).png" style="width: 225px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18807i0FBF819A8E62AA34/image-size/large?v=v2&amp;amp;px=999" role="button" title="socialcount_output (1).png" alt="socialcount_output (1).png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 12:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Million-Format/m-p/440168#M109912</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-02-26T12:43:18Z</dc:date>
    </item>
  </channel>
</rss>

