<?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: Result of input(var1,10.) displaying 3-length values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525200#M4899</link>
    <description>&lt;P&gt;I was just trying to manipulate date and conversion. No real objective, just SAS learning.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jan 2019 19:57:40 GMT</pubDate>
    <dc:creator>Masande</dc:creator>
    <dc:date>2019-01-07T19:57:40Z</dc:date>
    <item>
      <title>Result of input(var1,10.) displaying 3-length values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525130#M4893</link>
      <description>&lt;P&gt;Considering the following code,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data belg;
	set belg ;
	days=input(date,10.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where date is a numeric, 8 length variable with DDMMYY10. as format/informat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run it, days values are displayed in the dataset as 3-digits values. Changing the 10. to 12. allows to display the correct&amp;nbsp;SAS date values (5 digits ones). Why do I need to use a 12. informat while the initial variable is DDMMYY10. and the expected variable have&amp;nbsp;5-length values ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 17:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525130#M4893</guid>
      <dc:creator>Masande</dc:creator>
      <dc:date>2019-01-07T17:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Result of input(var1,10.) displaying 3-length values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525131#M4894</link>
      <description>&lt;P&gt;The first parameter to the INPUT function should always be a character string.&amp;nbsp; But here, you are using a numeric value.&amp;nbsp; So the question and answer hinge around how SAS handles that situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS takes the numeric value and converts it to character, so that the INPUT function can work.&amp;nbsp; You would already have received a note on the log about a numeric to character to conversion taking place, but didn't realize the implications.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When making a numeric to character conversion, SAS typically uses 12 characters to hold the result.&amp;nbsp; In this case, that would be 7 blanks, followed by 5 digits.&amp;nbsp; When you apply the 10. informat to that result, SAS reads 10 characters (7 blanks, plus the first 3 digits).&amp;nbsp; That's where your 3-digit numbers come from.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 18:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525131#M4894</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-07T18:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Result of input(var1,10.) displaying 3-length values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525178#M4896</link>
      <description>&lt;P&gt;What are you trying to actually do?&lt;/P&gt;
&lt;P&gt;If the variable has the format MMDDYY10. then it should already have a number of days.&amp;nbsp; SAS date formats work on numbers that represent the number of days since 1960, with 0 meaning 01JAN1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525178#M4896</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-07T19:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Result of input(var1,10.) displaying 3-length values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525200#M4899</link>
      <description>&lt;P&gt;I was just trying to manipulate date and conversion. No real objective, just SAS learning.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-input-var1-10-displaying-3-length-values/m-p/525200#M4899</guid>
      <dc:creator>Masande</dc:creator>
      <dc:date>2019-01-07T19:57:40Z</dc:date>
    </item>
  </channel>
</rss>

