<?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: informat about how many decimal place to be read? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32760#M6332</link>
    <description>You should not use decimals in your informat.&lt;BR /&gt;
&lt;BR /&gt;
Input x 6.;&lt;BR /&gt;
&lt;BR /&gt;
With decimals value 65 is read as 0.65

Message was edited by: Oleg_L</description>
    <pubDate>Fri, 18 Mar 2011 11:49:21 GMT</pubDate>
    <dc:creator>Oleg_L</dc:creator>
    <dc:date>2011-03-18T11:49:21Z</dc:date>
    <item>
      <title>informat about how many decimal place to be read?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32758#M6330</link>
      <description>As far as my knowledge is concerned, when a informat, such as &lt;I&gt;w.d&lt;/I&gt; or COMMA&lt;I&gt;w.d&lt;/I&gt;, is used in a input statement. The number of decimal place to be read is depended on the digit &lt;I&gt;d&lt;/I&gt; I specified in the informat. However, while I submit the following SAS code, the output are &lt;B&gt;rounded off to the 3rd decimal place rahter than the 2nd decimal place&lt;/B&gt;. Is my understanding about the informat wrong? Can anyone help me to explain the output? Thanks for your kindness and enthusiasm.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
  input x 6.2;&lt;BR /&gt;
cards;&lt;BR /&gt;
123.45&lt;BR /&gt;
65&lt;BR /&gt;
3.11&lt;BR /&gt;
9.025&lt;BR /&gt;
0.3983&lt;BR /&gt;
;&lt;BR /&gt;
proc print; run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
                The output is &lt;BR /&gt;
&lt;BR /&gt;
                                         Obs          x&lt;BR /&gt;
&lt;BR /&gt;
                                          1     123.450&lt;BR /&gt;
                                          2         0.650&lt;BR /&gt;
                                          3         3.110&lt;BR /&gt;
                                          4         9.025&lt;BR /&gt;
                                          5         0.398&lt;/B&gt;</description>
      <pubDate>Fri, 18 Mar 2011 09:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32758#M6330</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-18T09:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: informat about how many decimal place to be read?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32759#M6331</link>
      <description>Hi . you need a format to print it.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="Section1" style=""&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN class="GramE"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;data&lt;/SPAN&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; a;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;input&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; x &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;6.2&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;format&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; x &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;6.2&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN class="GramE"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;cards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;123.45&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;65&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;3.11&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;9.025&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% rgb(255, 255, 192);" lang="EN-US"&gt;0.3983&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style="text-align: left;" align="left"&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="MsoNormal" style=""&gt;&lt;SPAN class="GramE"&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;print&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black; background: none repeat scroll 0% 0% white;" lang="EN-US"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;/DIV&gt;&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 18 Mar 2011 10:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32759#M6331</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-18T10:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: informat about how many decimal place to be read?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32760#M6332</link>
      <description>You should not use decimals in your informat.&lt;BR /&gt;
&lt;BR /&gt;
Input x 6.;&lt;BR /&gt;
&lt;BR /&gt;
With decimals value 65 is read as 0.65

Message was edited by: Oleg_L</description>
      <pubDate>Fri, 18 Mar 2011 11:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32760#M6332</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-03-18T11:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: informat about how many decimal place to be read?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32761#M6333</link>
      <description>This is a fictitious data. I use it just want to demonstrate how the informat will influent different kinds of input data. Especially when the informat does not conform to the format of input data, the incompatible informat will effect the data SAS system actually read in. Hence the value 65 is read as 0.65 is just what I want to get. However, I encounter the unexpected problem aforementioned.</description>
      <pubDate>Fri, 18 Mar 2011 14:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32761#M6333</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-18T14:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: informat about how many decimal place to be read?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32762#M6334</link>
      <description>I think if you read the manual you'll find that your informat's ".2" will only be used when no decimal point is present in the raw source string.</description>
      <pubDate>Sat, 19 Mar 2011 09:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-about-how-many-decimal-place-to-be-read/m-p/32762#M6334</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-03-19T09:19:33Z</dc:date>
    </item>
  </channel>
</rss>

