<?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 datetime in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884076#M349263</link>
    <description>&lt;P&gt;What is wrong with your code? Please explain. If there are problems in the log, show us the ENTIRE log (not the first time we have asked). If the output is wrong, tell us in words what you are seeing that is incorrect.&lt;/P&gt;</description>
    <pubDate>Sun, 09 Jul 2023 10:35:20 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-07-09T10:35:20Z</dc:date>
    <item>
      <title>informat datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884074#M349262</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create data set by enter the data.&lt;/P&gt;
&lt;P&gt;What is the way to define the informat for data set "Have1"?&lt;/P&gt;
&lt;P&gt;Note- Informat for data set "Have2" is working well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input d_time : datetime18.;
format d_time datetime20.;
cards;
27/05/2023:06:05:00
03/10/2022:14:24:00
02/10/2022:20:19:00
;
Run;

data have2;
input d_time : datetime18.;
format d_time datetime20.;
cards;
27MAY2023:06:05:00
03OCT2022:14:24:00
02OCT2022:20:19:00
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Jul 2023 08:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884074#M349262</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-07-09T08:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: informat datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884076#M349263</link>
      <description>&lt;P&gt;What is wrong with your code? Please explain. If there are problems in the log, show us the ENTIRE log (not the first time we have asked). If the output is wrong, tell us in words what you are seeing that is incorrect.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2023 10:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884076#M349263</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-09T10:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: informat datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884080#M349264</link>
      <description>&lt;P&gt;You could try the ANYDTDTM informat.&lt;/P&gt;
&lt;PRE&gt;678  data have1;
679  input d_time : anydtdtm.;
680  format d_time datetime20.;
681  put d_time _infile_;
682  cards;

27MAY2023:06:05:00 27/05/2023:06:05:00
10MAR2022:14:24:00 03/10/2022:14:24:00
10FEB2022:20:19:00 02/10/2022:20:19:00
NOTE: The data set WORK.HAVE1 has 3 observations and 1 variables.
&lt;/PRE&gt;
&lt;P&gt;But&amp;nbsp; you will notice that for the ambiguous records where the first value could be either the month or the day of the month (at least on my machine) it defaults to use MDY ordering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to force it to use DMY order in those ambiguous situations then you need to se the datestyle option.&lt;/P&gt;
&lt;PRE&gt;690  options datestyle=dmy;
691  data have1;
692  input d_time : anydtdtm.;
693  format d_time datetime20.;
694  put d_time _infile_;
695  cards;

27MAY2023:06:05:00 27/05/2023:06:05:00
03OCT2022:14:24:00 03/10/2022:14:24:00
02OCT2022:20:19:00 02/10/2022:20:19:00
NOTE: The data set WORK.HAVE1 has 3 observations and 1 variables.
&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Jul 2023 12:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884080#M349264</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-09T12:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: informat datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884082#M349265</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input d ddmmyy10. @12 t time8.;
d_time = dhms(d,0,0,t);
format d_time datetime20.;
drop d t;
cards;
27/05/2023:06:05:00
03/10/2022:14:24:00
02/10/2022:20:19:00
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Jul 2023 12:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-datetime/m-p/884082#M349265</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-09T12:31:18Z</dc:date>
    </item>
  </channel>
</rss>

