<?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: reading datetime value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678750#M204913</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
input name $5. id :3. date :datetime20. ;
FORMAT DATE DATETIME20. ;

DATALINES;
ROHAN 123 11AUG2020:19:17:20
MOHAN 123 11AUG2020:20:15:20
SOHAN 123 13AUG2020:00:17:20
KOHAN 123 15AUG2020:19:17:20
;
RUN;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;Basically the idea is to read conveniently as a "modified list input" as opposed to using a in-formatted input.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Aug 2020 14:13:45 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-08-23T14:13:45Z</dc:date>
    <item>
      <title>reading datetime value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678749#M204912</link>
      <description>&lt;P&gt;I am trying to read date time column in my code. please find code below&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data check;&lt;BR /&gt;input name $5. id 3. date datetime20. ;&lt;BR /&gt;FORMAT DATE DATETIME20. ;&lt;BR /&gt;&lt;BR /&gt;DATALINES;&lt;BR /&gt;ROHAN 123 11AUG2020:19:17:20&lt;BR /&gt;MOHAN 123 11AUG2020:20:15:20&lt;BR /&gt;SOHAN 123 13AUG2020:00:17:20&lt;BR /&gt;KOHAN 123 15AUG2020:19:17:20&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;I am getting missing value in particular date coloumn and even the id value is not being read properly &lt;BR /&gt;I am getting only first two didgit.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2020 14:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678749#M204912</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2020-08-23T14:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: reading datetime value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678750#M204913</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
input name $5. id :3. date :datetime20. ;
FORMAT DATE DATETIME20. ;

DATALINES;
ROHAN 123 11AUG2020:19:17:20
MOHAN 123 11AUG2020:20:15:20
SOHAN 123 13AUG2020:00:17:20
KOHAN 123 15AUG2020:19:17:20
;
RUN;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;Basically the idea is to read conveniently as a "modified list input" as opposed to using a in-formatted input.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2020 14:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678750#M204913</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-08-23T14:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: reading datetime value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678751#M204914</link>
      <description>&lt;P&gt;Use the colon modifier in your INPUT statement, or it will not honor the delimiters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input name :$5. id :3. date :datetime20.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Aug 2020 14:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678751#M204914</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-23T14:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: reading datetime value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678752#M204915</link>
      <description>&lt;P&gt;You told the INPUT statement to read a fixed number of bytes for each variable.&amp;nbsp; Just count the columns to see why it is not working.&lt;/P&gt;
&lt;PRE&gt;----+---10----+---20----+---30
ROHAN 123 11AUG2020:19:17:20
MOHAN 123 11AUG2020:20:15:20
SOHAN 123 13AUG2020:00:17:20
KOHAN 123 15AUG2020:19:17:20&lt;/PRE&gt;
&lt;P&gt;If the values are really always in fixed columns then adjust your INPUT statement to read from the right columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @1 name $5. @7 id 3. @11 date datetime20. ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of if you know every line has three and only three space separated values and none of the values have embedded spaces then switch to list mode input instead of formatted mode.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input name :$5. id date :datetime20. ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Aug 2020 14:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678752#M204915</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-23T14:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: reading datetime value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678753#M204916</link>
      <description>Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 23 Aug 2020 14:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-datetime-value/m-p/678753#M204916</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2020-08-23T14:24:56Z</dc:date>
    </item>
  </channel>
</rss>

