<?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 Excel date-time to SAS Viya in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694091#M14366</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm pretty new in the SAS world. I need to create a dashboard for my exam in the university.&lt;/P&gt;&lt;P&gt;I want to upload a excel sheet to SAS Viya.&amp;nbsp;The upload is done via a Unicode text (*.txt). The upload itself works, but I can't manage to transfer the date into a clever format. The date in Excel is user defined in a german format (DD.MM.YYYY hh:mm:ss). How do I get the date converted to a SAS compatible fortmat? Unfortunately I am not familiar with SAS programming. Can I make settings in Excel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot. Greeting from Germany.&lt;/P&gt;</description>
    <pubDate>Sun, 25 Oct 2020 10:24:12 GMT</pubDate>
    <dc:creator>Kebru</dc:creator>
    <dc:date>2020-10-25T10:24:12Z</dc:date>
    <item>
      <title>Excel date-time to SAS Viya</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694091#M14366</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm pretty new in the SAS world. I need to create a dashboard for my exam in the university.&lt;/P&gt;&lt;P&gt;I want to upload a excel sheet to SAS Viya.&amp;nbsp;The upload is done via a Unicode text (*.txt). The upload itself works, but I can't manage to transfer the date into a clever format. The date in Excel is user defined in a german format (DD.MM.YYYY hh:mm:ss). How do I get the date converted to a SAS compatible fortmat? Unfortunately I am not familiar with SAS programming. Can I make settings in Excel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot. Greeting from Germany.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 10:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694091#M14366</guid>
      <dc:creator>Kebru</dc:creator>
      <dc:date>2020-10-25T10:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Excel date-time to SAS Viya</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694107#M14367</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/353983"&gt;@Kebru&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS should be able to read almost any datetime value whether from Germany, Ghana or Guiana.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, if I have a datetime formatted as 25.10.2020 09:49:25, the following SAS code will read that datetime value quite well.&amp;nbsp; Your LOCALE setting typically determines whether the date portion is read Day-Month-Year (common in Europe) or Month-Day-Year (common in North America).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	German_Formatted_Dates;
	INPUT	SAS_Date_Time	&amp;amp;	:	ANYDTDTM19.;
	Fmt_SAS_Date_Time	=	SAS_Date_Time;
	FORMAT	Fmt_SAS_Date_Time		DATETIME19.;
DATALINES;
25.10.2020 09:49:25
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1603638701715.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51037i6C303DE4D63B5177/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1603638701715.png" alt="jimbarbour_0-1603638701715.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Notice that I have &lt;EM&gt;two&lt;/EM&gt; values:&amp;nbsp; An unformatted value and a formatted value.&amp;nbsp; &lt;STRONG&gt;Both values are &lt;EM&gt;equal&lt;/EM&gt;&lt;/STRONG&gt;.&amp;nbsp; The second value has a FORMAT applied to it, and therefore is&amp;nbsp;&lt;EM&gt;displayed&amp;nbsp;&lt;/EM&gt;as 25OCT2020 09:49:25 but is&amp;nbsp;&lt;EM&gt;stored&amp;nbsp;&lt;/EM&gt; as 1919238565.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference between how data is formatted (or displayed) vs. how data is stored is important.&amp;nbsp; I suspect the German &lt;EM&gt;formatted&lt;/EM&gt; datetime values in your Excel file is actually &lt;EM&gt;stored&lt;/EM&gt; as an an Excel datetime value.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, the &lt;EM&gt;formatted&lt;/EM&gt; datetime value&amp;nbsp;25.10.2020 09:49:25 would be&amp;nbsp;&lt;EM&gt;stored&amp;nbsp;&lt;/EM&gt;as&amp;nbsp;44129.4093171296 in Excel.&amp;nbsp; There is a conversion formula to change the value to the equivalent value in SAS:&amp;nbsp; SAS_date_time = (Excel_date_time - 21916) * 86400;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following SAS code takes an Excel datetime for&amp;nbsp;25OCT2020 09:49:25 and converts it into a SAS datetime value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Excel_Dates;
	INPUT	Excel_Date_Time;
	SAS_date_time = (Excel_date_time - 21916) * 86400;
	FORMAT	SAS_Date_Time		DATETIME19.;
DATALINES;
44129.4093171296
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;DIV id="tinyMceEditorjimbarbour_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1603639437757.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51038iC84B6F65B38DA97C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1603639437757.png" alt="jimbarbour_0-1603639437757.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you will need this conversion formula to bring your data into SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a paper on the subject if it is helpful:&amp;nbsp;&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/068-29.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/068-29.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 15:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694107#M14367</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-25T15:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Excel date-time to SAS Viya</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694565#M14374</link>
      <description>&lt;P&gt;Jim's answer should work if you have permissions to perform data preparation in your environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can only import and format the data within Visual Analytics, you can format the date values by creating a calculated item that uses the Parse() operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know if this helps,&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 13:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-date-time-to-SAS-Viya/m-p/694565#M14374</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2020-10-27T13:03:42Z</dc:date>
    </item>
  </channel>
</rss>

