<?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 HELP : format xxxxx 9.5 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177645#M45455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy new year to you all. I have a question concernant a command I've come across and that I need to do my project. Here it is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data projet.portefeuille_1; &lt;/P&gt;&lt;P&gt;set projet.portefeuille;&lt;/P&gt;&lt;P&gt;format rdt_portf &lt;STRONG style="color: #ff0000;"&gt;9.5&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;rdt_portf=1/3*rdt_al+1/3*rdt_bnp+1/3*rdt_brt; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is the "9.5" I'm not getting. What does it mean ?? Because when I change it to 10.5 or to 8.6 for example, it changes my data values completely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jan 2015 21:35:44 GMT</pubDate>
    <dc:creator>Waliyya</dc:creator>
    <dc:date>2015-01-10T21:35:44Z</dc:date>
    <item>
      <title>HELP : format xxxxx 9.5</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177645#M45455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy new year to you all. I have a question concernant a command I've come across and that I need to do my project. Here it is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data projet.portefeuille_1; &lt;/P&gt;&lt;P&gt;set projet.portefeuille;&lt;/P&gt;&lt;P&gt;format rdt_portf &lt;STRONG style="color: #ff0000;"&gt;9.5&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;rdt_portf=1/3*rdt_al+1/3*rdt_bnp+1/3*rdt_brt; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is the "9.5" I'm not getting. What does it mean ?? Because when I change it to 10.5 or to 8.6 for example, it changes my data values completely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 21:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177645#M45455</guid>
      <dc:creator>Waliyya</dc:creator>
      <dc:date>2015-01-10T21:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: HELP : format xxxxx 9.5</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177646#M45456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should not change the values, just how SAS displays them.&lt;/P&gt;&lt;P&gt;9.5 means that it will use 5 decimal spaces and a total of 9 characters to display the value. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 22:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177646#M45456</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-10T22:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: HELP : format xxxxx 9.5</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177647#M45457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I suggest you review some of the concept information about SAS data, especially the information about FORMATS. There is a good documentation topic entitled "Essential Concepts of Base SAS Software" that discusses variable attributes, such as formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Basically, the format (what you specify in the FORMAT statement) controls how the variable value is printed or displayed in procedures like PROC PRINT (for example). The FORMAT statement does NOT impact the internally stored value, but, instead just impacts the DISPLAY of a variable value.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Usually a format such as you show: format rdt_portf &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;9.5&lt;/STRONG&gt;&lt;/SPAN&gt;; would provide instructions to SAS to take the value for the RDT_PORTF variable and use 9 total print positions to display the value. Of the 9 total print positions, 5 positions would be used for the decimal portion of the number and 1 position would be used for the decimal (punctuation).&amp;nbsp; So, effectively, that would be:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;123456789&amp;nbsp; &amp;lt;--- number of print positions&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;###.#####&amp;nbsp; &amp;lt;--- what you are asking for&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;568.94302&amp;nbsp; &amp;lt;---example&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;But a format of 8.6 implies that you want SAS to use 8 total positions and use 6 of the positions for decimal places and 1 position for the decimal&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;12345678&amp;nbsp; &amp;lt;--- number of print positions&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;#.######&amp;nbsp; &amp;lt;--- what you are asking for&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;3.141592&amp;nbsp; &amp;lt;--- example&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So a format of 11.6 would be asking for this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;####.###### &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;5489.356124 &amp;lt;--- example &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And a format of 12.6 would be asking for this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;#####.###### &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 14pt;"&gt;&lt;STRONG&gt;43983.849211 &amp;lt;--- example&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;As you might imagine the consequences of specifying a format that is too small might cause unwanted rounding or cause the number not to display correctly. So for example, if you know that your biggest salary is 123456.78 and you want to display that number with a dollar sign, commas, a decimal point and 2 positions, then you need a minimum of 11 total print positions: &lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;$&lt;/SPAN&gt;123&lt;SPAN style="color: #ff0000;"&gt;,&lt;/SPAN&gt;456&lt;SPAN style="color: #ff0000;"&gt;.&lt;/SPAN&gt;78&lt;/STRONG&gt;&lt;/SPAN&gt; because you have 8 numbers, a decimal point, a comma and a dollar sign, each of which takes a print position. So the format you would specify in this case would be&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;format salary dollar11.2; &lt;/STRONG&gt; And, it would be wrong to make the format something like &lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;dollar8.2&lt;/STRONG&gt;&lt;/SPAN&gt;, because that is not "enough" print positions to display the number the way you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; It is up to you to know how "big" your numbers are and what type of punctuation you want in the number (. , $ %) every character you use takes a print position. So you have to make your format number "wide" enough for the number, decimal places and other punctuation to fit. Here's a program you can run, which was used to produce the output shown in the attached explanation. Basically, every variable in the test data has the same internal value: 1234.56 but each variable is formatted differently. Note that if you make the format too small, you most often get undesirable results. Also note that the INTERNAL value of the variable is not impacted by the format assigned to the variable. Only the external display of the number is impacted by the format. The report specifies Courier New as the font for display purposes, so that each character takes up the same amount of display space. Otherwise, in a proportional font, the number 1 takes up less "display" space than the number 8.&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;data testfmt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; a = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; b = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; c = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; d = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; e = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; f = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; g = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; h = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; i = 1234.56;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=testfmt label split='*' &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; style(header)={font_face='Courier New'};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title 'Same internal number: 1234.56';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; var a b c d e f g h i/ style(column)={font_face='Courier New'};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; format a 11.1 b 11.2 c 11.3 d 11.4 e 8.2 f 8.1 g 8.0 h 3.2 i 2.1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; label a= 'a*format is 11.1'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b= 'b*format is 11.2'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c= 'c*format is 11.3'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d= 'd*format is 11.4'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e= 'e*format is 8.2'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f= 'f*format is 8.1' &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g= 'g*format is 8.0'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h= 'h*format is 3.2'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i= 'i*format is 2.1';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/10811i41793772196A8DF9/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="explain_format_usage.png" title="explain_format_usage.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 23:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/HELP-format-xxxxx-9-5/m-p/177647#M45457</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-01-10T23:11:44Z</dc:date>
    </item>
  </channel>
</rss>

