<?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 Informat for date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505357#M135320</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dates vary in length. single digit months and single digit days do not have leading zeroes.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;WHENCREATED&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;9/20/2018 7:58 AM&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;9/2/2018 7:00 AM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;11/20/2018 9:58 AM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.CHRONIC_ABSENTEEISM;
infile 'G:\FAKEPATH\Chronic_Absenteeism.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;

informat WHENCREATED ???;

format SchoolYear 4. CollectionID $4. DISTRICTCODE 4.;
	
input  SchoolYear	CollectionID $	DISTRICTCODE WHENCREATED;
run;	&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Oct 2018 21:18:16 GMT</pubDate>
    <dc:creator>GreggB</dc:creator>
    <dc:date>2018-10-17T21:18:16Z</dc:date>
    <item>
      <title>Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505357#M135320</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dates vary in length. single digit months and single digit days do not have leading zeroes.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;WHENCREATED&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;9/20/2018 7:58 AM&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;9/2/2018 7:00 AM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;11/20/2018 9:58 AM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.CHRONIC_ABSENTEEISM;
infile 'G:\FAKEPATH\Chronic_Absenteeism.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;

informat WHENCREATED ???;

format SchoolYear 4. CollectionID $4. DISTRICTCODE 4.;
	
input  SchoolYear	CollectionID $	DISTRICTCODE WHENCREATED;
run;	&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505357#M135320</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2018-10-17T21:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505365#M135328</link>
      <description>&lt;P&gt;Do you want a date or datetime? They are different.&lt;/P&gt;
&lt;P&gt;Unless you have reason to suspect that you have incomplete or partial dates you might try ANYDTDTM32.&lt;/P&gt;
&lt;P&gt;Assign a datetime19. or longer format to display a 4 digit year.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505365#M135328</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-17T21:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505422#M135345</link>
      <description>&lt;P&gt;Hello Sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Morning !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion on above question . I applied informat and format as mention. But while applying format&amp;nbsp;datetime20. or&amp;nbsp;&lt;SPAN&gt;datetime19. , view of date &amp;amp; time got change. if i applied only any date format then it's working perfectly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is my code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data test;&lt;BR /&gt;input date anydtdte32.;&lt;BR /&gt;format date datetime20.;&lt;BR /&gt;cards;&lt;BR /&gt;9/20/2018 7:58 AM&lt;BR /&gt;9/2/2018 7:00 AM&lt;BR /&gt;11/20/2018 9:58 AM&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;here is output .&amp;nbsp; Looking for your suggestion .&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 341px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24123i8C020FBA4B15D476/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 03:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505422#M135345</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-18T03:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505423#M135346</link>
      <description>&lt;P&gt;You have a date and not a datetime.&lt;/P&gt;
&lt;P&gt;Use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;format date date9.;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 03:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505423#M135346</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-18T03:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505432#M135347</link>
      <description>&lt;P&gt;Try mdyampm20. as informat, instead of &lt;SPAN&gt;anydtdte32.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 04:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505432#M135347</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-10-18T04:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505446#M135352</link>
      <description>&lt;P&gt;Use the mdyampm informat, as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;, and a proper datetime format for display:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards dlm=',' truncover;
input
  schoolyear :4.
  collectionid :$4.
  districtcode :$4.
  whencreated :mdyampm25.
;
format whencreated e8601dt20.;
cards;
2018,AAAA,AAAA,9/20/2018 7:58 AM
2018,BBBB,BBBB,9/2/2018 7:00 AM
2018,CCCC,CCCC,11/20/2018 9:58 AM
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 07:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505446#M135352</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T07:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505529#M135383</link>
      <description>&lt;P&gt;You&amp;nbsp; are using WRONG informat .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input date &lt;STRONG&gt;anydtdt&lt;FONT color="#FF0000"&gt;m&lt;/FONT&gt;32.&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505529#M135383</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-10-18T13:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505614#M135426</link>
      <description>&lt;P&gt;I don't get an error when using&amp;nbsp;&lt;STRONG&gt;anydtdt&lt;FONT color="#FF0000"&gt;m&lt;/FONT&gt;32.&lt;/STRONG&gt;&lt;SPAN&gt;; but it returns all values as missing.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 15:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505614#M135426</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2018-10-18T15:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Informat for date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505680#M135453</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153275"&gt;@singhsahab&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Sir,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good Morning !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your suggestion on above question . I applied informat and format as mention. But while applying format&amp;nbsp;datetime20. or&amp;nbsp;&lt;SPAN&gt;datetime19. , view of date &amp;amp; time got change. if i applied only any date format then it's working perfectly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is my code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data test;&lt;BR /&gt;input date &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;anydtdte32.;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;format date datetime20.;&lt;BR /&gt;cards;&lt;BR /&gt;9/20/2018 7:58 AM&lt;BR /&gt;9/2/2018 7:00 AM&lt;BR /&gt;11/20/2018 9:58 AM&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;here is output .&amp;nbsp; Looking for your suggestion .&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 341px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24123i8C020FBA4B15D476/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suggested &lt;STRONG&gt;ANYDTDTM32 &lt;/STRONG&gt; and expected to be reading from an external file. Your input would be incorrect in data lines as you are not accounting for spaces&lt;/P&gt;
&lt;PRE&gt;data test;
infile datalines dsd;
input date anydtdtm32.;
format date datetime20.;
cards;
9/20/2018 7:58 AM
9/2/2018 7:00 AM
11/20/2018 9:58 AM
;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 18:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Informat-for-date/m-p/505680#M135453</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-18T18:13:25Z</dc:date>
    </item>
  </channel>
</rss>

