<?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: Sizekmg format to show TB in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389733#M277419</link>
    <description>&lt;P&gt;Unfortunately the fortmatted value in the 4th obs is wrong. 65536 Bytes are 64 kiB.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2017 07:52:53 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2017-08-22T07:52:53Z</dc:date>
    <item>
      <title>Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388671#M277412</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does any one know how to use SizeKMG format to display values in Terabyte.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now, it only prrints KB, MB &amp;amp; GB.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need extension for TB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 01:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388671#M277412</guid>
      <dc:creator>aj34321</dc:creator>
      <dc:date>2017-08-17T01:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388687#M277413</link>
      <description>&lt;P&gt;You can create a nested format&lt;/P&gt;
&lt;P&gt;Quick skeleton:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format ;&lt;/P&gt;
&lt;P&gt;value customTB&lt;/P&gt;
&lt;P&gt;Low - ##### =[sizekgm]&lt;/P&gt;
&lt;P&gt;other = ...;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use PROC FCMP to embed a calculation if needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 04:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388687#M277413</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-17T04:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388693#M277414</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let onetb=%sysevalf(1024**4);

proc format ;
  picture sizekmgt 0       -&amp;lt; &amp;amp;onetb. = [sizekmg10.]
                   &amp;amp;onetb. -  high    = '000000.9TB' (multiplier=%sysevalf(1/&amp;amp;onetb.)) ;
run;
                                                                
data _null_; B=2222e6; C=2222e9; putlog (B C) (sizekmgt.); run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;2GB 2TB&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Modify the picture to suit.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 05:27:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388693#M277414</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-08-17T05:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388699#M277415</link>
      <description>&lt;P&gt;While you are at it, change the KB to kB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Americans (not only) are still confused&amp;nbsp;with the metric system's units (K is Kelvin, k is kilo). &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even better, you can redefine the units to &lt;A href="https://en.wikipedia.org/wiki/Kibibyte" target="_self"&gt;kiB and MiB&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 05:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/388699#M277415</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-08-17T05:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389484#M277416</link>
      <description>&lt;P&gt;Thanks Chris. This is what exactly i want, but now how do i format this, like if i have to pass on as below format&lt;/P&gt;
&lt;P&gt;sizekmgt10.2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if a number is&amp;nbsp;1599511627776 then the output should be &amp;nbsp;1.59 TB and &amp;nbsp;if i use format &amp;nbsp;&lt;SPAN&gt;sizekmgt10.4; then the output should be 1.5995 TB&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, 21 Aug 2017 10:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389484#M277416</guid>
      <dc:creator>aj34321</dc:creator>
      <dc:date>2017-08-21T10:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389503#M277417</link>
      <description>&lt;P&gt;Looks like you are pretty close with the solution from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;, but here's another approach that builds a format from scratch, &lt;A href="http://blogs.sas.com/content/sasdummy/2014/08/13/social-media-counts-formats/" target="_self"&gt;documented in this blog post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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.png" style="width: 225px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/14566i9AF78481C51B59EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="socialcount_output.png" alt="socialcount_output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389503#M277417</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-08-21T12:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389670#M277418</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37860"&gt;@aj34321&lt;/a&gt;&amp;nbsp;That's not how picture formats work sadly. You choose the position of the decimal point when you build the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 21:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389670#M277418</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-08-21T21:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389733#M277419</link>
      <description>&lt;P&gt;Unfortunately the fortmatted value in the 4th obs is wrong. 65536 Bytes are 64 kiB.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 07:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389733#M277419</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-08-22T07:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sizekmg format to show TB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389786#M277420</link>
      <description>&lt;P&gt;My example there was not about "computer Ks" -- multiples of 1024. &amp;nbsp;My example was more about rounding in the social media sphere, where a "k" is 1000. &amp;nbsp;It's not usable as-is for your purpose, but I shared it as an example of what a complete format definition might look like. &amp;nbsp;The sizekmg format does the proper math for this case.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 12:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sizekmg-format-to-show-TB/m-p/389786#M277420</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-08-22T12:40:06Z</dc:date>
    </item>
  </channel>
</rss>

