<?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: date from datetime with proc ods in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683317#M24440</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52150"&gt;@rajeshm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;/* mmdd2&amp;nbsp;02AUG2020:00:00:00 datetime20. in sas dataset tab */&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table Deposits_DetailXX as &lt;BR /&gt;select &lt;BR /&gt;MMDD2 format=&lt;STRONG&gt;dtdate9&lt;/STRONG&gt;.,&lt;BR /&gt;from tab;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when i exported deposits_detailxx , getting mdd2 as largenumber. what should i do to get date9. format?&lt;/P&gt;
&lt;P&gt;/* datepart function with date9. is working fine. but would like to know otherways. */&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exported to Excel? I am guessing this from your other thread. These are details that should be mentioned. How are you doing the export? Show us that part of the code.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2020 17:31:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-09-11T17:31:27Z</dc:date>
    <item>
      <title>date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/682829#M24426</link>
      <description>&lt;PRE&gt;ods listing close;
ods results off;
ods csv file='/xxxx/Aug.csv' ;
proc print data=final noobs;
format xxdate mmddyy10.;
run;
ods csv close;
ods results on;
ods listing;
&lt;/PRE&gt;
&lt;P&gt;xxdate field inside sas is&amp;nbsp; 02JAN2019:00:00:00(field is datetime20 format and informat)&lt;/P&gt;
&lt;P&gt;ods with csv sheet should contain&amp;nbsp; 02JAN2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 06:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/682829#M24426</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-09-10T06:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/682898#M24428</link>
      <description>&lt;P&gt;Since variable xxdate is a date/time variable, you can only use datetime formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MMDDYY10. is a date format, not a datetime format. (How do you know? See the list of date and time formats at&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-format.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-format.htm&amp;amp;locale=en&lt;/A&gt;, where it says that MMDDYY is a date format. So you can't use this date format on your date/time values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 520px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49231i7178A9FB3D49DCCA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, checking the same list, the DTDATE format is a date/time format that outputs dates as 01JAN20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 710px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49233i1BD127C0C84370E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 11:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/682898#M24428</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-09-10T11:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683306#M24436</link>
      <description>&lt;P&gt;/* mmdd2&amp;nbsp;02AUG2020:00:00:00 datetime20. in sas dataset tab */&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table Deposits_DetailXX as &lt;BR /&gt;select &lt;BR /&gt;MMDD2 format=&lt;STRONG&gt;dtdate9&lt;/STRONG&gt;.,&lt;BR /&gt;from tab;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when i exported deposits_detailxx , getting mdd2 as largenumber. what should i do to get date9. format?&lt;/P&gt;
&lt;P&gt;/* datepart function with date9. is working fine. but would like to know otherways. */&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 16:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683306#M24436</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-09-11T16:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683308#M24437</link>
      <description>&lt;P&gt;The DATEPART function is the correct tool for extracting dates from datetimes. Use it.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683308#M24437</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-11T17:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683309#M24438</link>
      <description>&lt;P&gt;If you want to know an important fact about the relationship of dates and datetimes, here's a hint: a day consists of 86400 seconds.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683309#M24438</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-11T17:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683315#M24439</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;The DATEPART function is the correct tool for extracting dates from datetimes. Use it.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;format=DTDATE9. also works when I try it in PROC SQL, so there must be something else that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52150"&gt;@rajeshm&lt;/a&gt;&amp;nbsp;is not doing properly.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683315#M24439</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-09-11T17:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683317#M24440</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52150"&gt;@rajeshm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;/* mmdd2&amp;nbsp;02AUG2020:00:00:00 datetime20. in sas dataset tab */&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table Deposits_DetailXX as &lt;BR /&gt;select &lt;BR /&gt;MMDD2 format=&lt;STRONG&gt;dtdate9&lt;/STRONG&gt;.,&lt;BR /&gt;from tab;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when i exported deposits_detailxx , getting mdd2 as largenumber. what should i do to get date9. format?&lt;/P&gt;
&lt;P&gt;/* datepart function with date9. is working fine. but would like to know otherways. */&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exported to Excel? I am guessing this from your other thread. These are details that should be mentioned. How are you doing the export? Show us that part of the code.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683317#M24440</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-09-11T17:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: date from datetime with proc ods</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683319#M24441</link>
      <description>&lt;P&gt;you have given correct solution but i am merging. i posted a new question/thread.&lt;/P&gt;
&lt;P&gt;thanks for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 17:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/date-from-datetime-with-proc-ods/m-p/683319#M24441</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-09-11T17:46:43Z</dc:date>
    </item>
  </channel>
</rss>

