<?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 anydtdte issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744694#M233331</link>
    <description>Thanks, Astounding.&lt;BR /&gt;You save me a lot of time by try and error.&lt;BR /&gt;The example of the answer are as follows:&lt;BR /&gt;data two;&lt;BR /&gt;infile CSV;&lt;BR /&gt;OPTIONS DATESTYLE=MDY;&lt;BR /&gt;INPUT&lt;BR /&gt;@1 Incident best12.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt; Summary $1.&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Victor</description>
    <pubDate>Sun, 30 May 2021 17:38:38 GMT</pubDate>
    <dc:creator>VictorHsieh</dc:creator>
    <dc:date>2021-05-30T17:38:38Z</dc:date>
    <item>
      <title>informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744671#M233313</link>
      <description />
      <pubDate>Sun, 30 May 2021 15:01:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744671#M233313</guid>
      <dc:creator>VictorHsieh</dc:creator>
      <dc:date>2021-05-30T15:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744673#M233314</link>
      <description>&lt;P&gt;Please include text (like code and data) in your message directly, rather than through attachments. Many people will not download attachments, and specifically Microsoft Office documents are a security threat when downloaded.&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 15:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744673#M233314</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-30T15:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744676#M233316</link>
      <description>The issues are that y=input(put(dp1,10.),anydtdte10.); did not convert dp1(4/1/2021) into right date. Instead, y(1/4/2021) was converted. The question is that how does anydtdte know dp1 is mmddyy format or ddmmyy format. In the whole report that from 4/1/2021 through 14/12/2021 were treated as ddmmyy until reaching 4/13/2021, then were treated as mmddyy format.&lt;BR /&gt;Please advose. Thank you.&lt;BR /&gt;</description>
      <pubDate>Sun, 30 May 2021 15:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744676#M233316</guid>
      <dc:creator>VictorHsieh</dc:creator>
      <dc:date>2021-05-30T15:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744677#M233317</link>
      <description>y=input(put(dp1,10.),anydtdte10.);&lt;BR /&gt;format y mmddyy10.;&lt;BR /&gt;wday1=weekday(y);&lt;BR /&gt;Obs incident idx1 idx2 dp1 dp y wday1 createdon_d CreatedOn resolvedon_d Resolvedon closedon_d Closedon&lt;BR /&gt;1 81402 STG CSV 4/1/2021 . 1/4/2021 2 4/1/2021 10:43 4/1/2021 5:43 NULL 4/1/2021 10:45 4/1/2021 5:45&lt;BR /&gt;2 81403 STG CSV 4/1/2021 . 1/4/2021 2 4/1/2021 10:43 4/1/2021 5:43 NULL 4/1/2021 10:46 4/1/2021 5:46&lt;BR /&gt;&lt;BR /&gt;Why dp1 was converted from 4/1/2021 into 1/4/2021?</description>
      <pubDate>Sun, 30 May 2021 15:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744677#M233317</guid>
      <dc:creator>VictorHsieh</dc:creator>
      <dc:date>2021-05-30T15:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744681#M233320</link>
      <description>SAS doesn't know whether ambiguous data is in mdy form or dmy form.  Do you know?  If so, you can use the DATESTYLE option to tell SAS which interpretation to use, either of:&lt;BR /&gt;&lt;BR /&gt;options datestyle=dmy;&lt;BR /&gt;&lt;BR /&gt;options datestyle=mdy;</description>
      <pubDate>Sun, 30 May 2021 16:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744681#M233320</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-05-30T16:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744682#M233321</link>
      <description>&lt;P&gt;The ANYDTxxxx informat will have to GUESS which parts of the string is the month and which is day when the day value is less than 13.&amp;nbsp; &amp;nbsp;It will use the DATESTYLE setting to tell it which to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set it to the style you want it to use.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot tell from your question whether you want MDY or DMY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is '4/1/2021' supposed to be the fourth of January or April first?&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 16:48:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744682#M233321</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-30T16:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744683#M233322</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/228533"&gt;@VictorHsieh&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The following option will tell you what the data style will be in the case of ambiguity.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option=datestyle;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the response in the log output is like the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; DATESTYLE=MDY     Specifies the sequence of month, day, and year when ANYDTDTE, ANYDTDTM, or ANYDTTME informat data is ambiguous.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You need to run this option on your system and it will explain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 16:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744683#M233322</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-30T16:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744686#M233325</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Why dp1 was converted from 4/1/2021 into 1/4/2021?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;That depends, in the end, on the SAS installation you are running on. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;remarked, SAS does not "know" which date informat you want as the default. It guesses from the setting of the LOCALE system option, if it is European you will most often get DMY, if it is American, you will definitely get MDY. So, if you are using ANYDTDTE., always assign the DATESTYLE option first. Otherwise, your program will give one result on some installations, and another on other installations.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Being European (Danish) myself, I work half the time (or thereabout) on installations that use LOCALE=DA_DK, and the rest of the time on installations using the SAS System default, which is EN_US or something like that. And they give different results for ANYDTDTE without the DATESTYLE option.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 16:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744686#M233325</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2021-05-30T16:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: informat anydtdte issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744694#M233331</link>
      <description>Thanks, Astounding.&lt;BR /&gt;You save me a lot of time by try and error.&lt;BR /&gt;The example of the answer are as follows:&lt;BR /&gt;data two;&lt;BR /&gt;infile CSV;&lt;BR /&gt;OPTIONS DATESTYLE=MDY;&lt;BR /&gt;INPUT&lt;BR /&gt;@1 Incident best12.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt; Summary $1.&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Victor</description>
      <pubDate>Sun, 30 May 2021 17:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/informat-anydtdte-issue/m-p/744694#M233331</guid>
      <dc:creator>VictorHsieh</dc:creator>
      <dc:date>2021-05-30T17:38:38Z</dc:date>
    </item>
  </channel>
</rss>

