<?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: One process for both DATE and DATETIME in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1011#M291</link>
    <description>The last remark is true. I should have added a WHERE statement in the SQL procedure. Something like :&lt;BR /&gt;
&lt;BR /&gt;
WHERE UPCASE(format) = "DATETIME"&lt;BR /&gt;
&lt;BR /&gt;
should focus conversion on DateTime variables only.

&lt;BR /&gt;
Message was edited by: Olivier at Sep 29, 2006 9:08 AM&lt;BR /&gt;</description>
    <pubDate>Fri, 29 Sep 2006 13:05:11 GMT</pubDate>
    <dc:creator>Olivier</dc:creator>
    <dc:date>2006-09-29T13:05:11Z</dc:date>
    <item>
      <title>One process for both DATE and DATETIME</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1008#M288</link>
      <description>I've got an ETL job that I want to be able to attach to multiple databases. One database has dates stored as DATETIME's and the other only as DATE's.&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to use one set of steps to convert these all to consistant SAS dates?</description>
      <pubDate>Fri, 07 Jul 2006 18:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1008#M288</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-07-07T18:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: One process for both DATE and DATETIME</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1009#M289</link>
      <description>You should consider using this little program... (In a Code window.)&lt;BR /&gt;
&lt;BR /&gt;
%LET dsIn = ... ; /* your existing DATETIME dataset*/&lt;BR /&gt;
%LET dsOut = ... ; /* your converted dataset ; you can use the same name twice, and you will have your existing dataset replaced */&lt;BR /&gt;
/*************************************************/&lt;BR /&gt;
/* DO NOT EDIT ANYTHING AFTER THIS LINE          */&lt;BR /&gt;
/*************************************************/&lt;BR /&gt;
PROC CONTENTS DATA = &amp;amp;dsIn (KEEP = _numeric_)&lt;BR /&gt;
               OUT = work.dictionary &lt;BR /&gt;
              NOPRINT ;&lt;BR /&gt;
RUN ;&lt;BR /&gt;
PROC SQL NOPRINT ;&lt;BR /&gt;
   SELECT name INTO : varToConvert SEPARATED BY " "&lt;BR /&gt;
   FROM work.dictionary&lt;BR /&gt;
   ;&lt;BR /&gt;
QUIT ;&lt;BR /&gt;
DATA &amp;amp;dsOut ;&lt;BR /&gt;
   SET &amp;amp;dsIn ;&lt;BR /&gt;
   ARRAY datetimes &amp;amp;varToConvert ;&lt;BR /&gt;
   DO OVER dateTimes ;&lt;BR /&gt;
     dateTimes = DATEPART(dateTimes) ;&lt;BR /&gt;
   END ;&lt;BR /&gt;
   FORMAT &amp;amp;varToConvert DDMMYY10. ;&lt;BR /&gt;
RUN ;</description>
      <pubDate>Tue, 11 Jul 2006 13:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1009#M289</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2006-07-11T13:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: One process for both DATE and DATETIME</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1010#M290</link>
      <description>I noticed that the DATEPART function applied to a variable having date format (without time part) produces completely wrong results. So it is necessary to be sure that DATEPART is always applied to date-time variables.</description>
      <pubDate>Thu, 28 Sep 2006 19:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1010#M290</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2006-09-28T19:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: One process for both DATE and DATETIME</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1011#M291</link>
      <description>The last remark is true. I should have added a WHERE statement in the SQL procedure. Something like :&lt;BR /&gt;
&lt;BR /&gt;
WHERE UPCASE(format) = "DATETIME"&lt;BR /&gt;
&lt;BR /&gt;
should focus conversion on DateTime variables only.

&lt;BR /&gt;
Message was edited by: Olivier at Sep 29, 2006 9:08 AM&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2006 13:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/One-process-for-both-DATE-and-DATETIME/m-p/1011#M291</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2006-09-29T13:05:11Z</dc:date>
    </item>
  </channel>
</rss>

