<?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: Input two date variables into a data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460471#M117046</link>
    <description>&lt;P&gt;/*Or*/&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
informat date_one date_two date9.;
input  date_one date_two ;
format  date_one date_two  date9. ;
datalines;
10Jan2000 20Mar2010
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 May 2018 15:19:20 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-05-07T15:19:20Z</dc:date>
    <item>
      <title>Input two date variables into a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460434#M117030</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I do not understand why my second column does not read as date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input  date_one date9. date_two date9. ;
datalines;
10Jan2000 20Mar2010
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As I am new to SAS, please help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 14:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460434#M117030</guid>
      <dc:creator>Myurathan</dc:creator>
      <dc:date>2018-05-07T14:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Input two date variables into a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460441#M117037</link>
      <description>&lt;P&gt;Corrected code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input  date_one : date9. date_two : date9. ;
format  date_one date_two  date9. ;
datalines;
10Jan2000 20Mar2010
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 May 2018 14:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460441#M117037</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-07T14:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Input two date variables into a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460471#M117046</link>
      <description>&lt;P&gt;/*Or*/&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
informat date_one date_two date9.;
input  date_one date_two ;
format  date_one date_two  date9. ;
datalines;
10Jan2000 20Mar2010
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 May 2018 15:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460471#M117046</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-07T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Input two date variables into a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460495#M117050</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/175837"&gt;@Myurathan&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I do not understand why my second column does not read as date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input  date_one date9. date_two date9. ;
datalines;
10Jan2000 20Mar2010
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As I am new to SAS, please help me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Look very closely at your input statement and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;'s .&lt;/P&gt;
&lt;P&gt;Then take a look at the result here:&lt;/P&gt;
&lt;PRE&gt;data test;
input  date_one date9. date_two date9. ;
format date_one date_two date9.;
datalines;
10Jan200020Mar2010
;
run;&lt;/PRE&gt;
&lt;P&gt;The form of input statement you used is for fixed column input. So it was reading the blank after the first value as the first character of the next field, with the resulting 9 characters read being " 20mar201" which is not a valid date value. The : modifies the informat to skip blanks on input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 16:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-two-date-variables-into-a-data-set/m-p/460495#M117050</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-07T16:11:49Z</dc:date>
    </item>
  </channel>
</rss>

