<?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: Excel Values change in SAS in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594474#M13142</link>
    <description>&lt;P&gt;Not sure how you are reading the data from Excel into VA, but if you use the PROC IMPORT available in SAS you will end up with strings that look like that if the column (variable) in the Excel sheet has mixed numeric (dates are stored as numbers in SAS and Excel) and character values.&amp;nbsp; To pull that into a dataset SAS will need to make the variable a character string. But when it does that it just converts the numbers that Excel uses to store Date (and DateTime) values. Excel stores dates are the number of days since 1900 and time as a fraction of a day.&amp;nbsp; So a datetime value looks like a number with fractional part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can fix the report to not put character strings into any of the cells in the column with the datetime values then SAS should read it as a number and convert the value for you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you cannot then you will need to derive a new variable, since you cannot change the type of a variable from character to numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS code like this should work.&amp;nbsp; Not clear to me how to do that in VA.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  date_var = dhms(input(char_var,32.)+'30DEC1899'd,0,0,0);
  format date_var datetime20.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Oct 2019 15:01:16 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-10-07T15:01:16Z</dc:date>
    <item>
      <title>Excel Values change in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594420#M13140</link>
      <description>&lt;P&gt;Hi i have a project where i have to use data collected from sensors to create a dashboard. The data is saved in excel document and then later dispalyed in SAS VA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The format of the data in question is in this format below:&lt;/P&gt;&lt;P&gt;yyyy:mm:dd hh:mm:ss&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data displayed in excel comes out legible as the format above. However, when pumped in to SAS VA the information is displayed as decimal numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can any one here clarify?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 06:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594420#M13140</guid>
      <dc:creator>DandarahZ</dc:creator>
      <dc:date>2019-10-07T06:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Values change in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594428#M13141</link>
      <description>&lt;P&gt;How do you read your Excel files into SAS?&lt;/P&gt;
&lt;P&gt;Note that this is not a standardized format for datetimes. I'd much rather use the ISO 8601 format:&lt;/P&gt;
&lt;P&gt;yyyy-mm-ddThh:mm:ss&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 07:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594428#M13141</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-07T07:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Values change in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594474#M13142</link>
      <description>&lt;P&gt;Not sure how you are reading the data from Excel into VA, but if you use the PROC IMPORT available in SAS you will end up with strings that look like that if the column (variable) in the Excel sheet has mixed numeric (dates are stored as numbers in SAS and Excel) and character values.&amp;nbsp; To pull that into a dataset SAS will need to make the variable a character string. But when it does that it just converts the numbers that Excel uses to store Date (and DateTime) values. Excel stores dates are the number of days since 1900 and time as a fraction of a day.&amp;nbsp; So a datetime value looks like a number with fractional part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can fix the report to not put character strings into any of the cells in the column with the datetime values then SAS should read it as a number and convert the value for you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you cannot then you will need to derive a new variable, since you cannot change the type of a variable from character to numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS code like this should work.&amp;nbsp; Not clear to me how to do that in VA.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  date_var = dhms(input(char_var,32.)+'30DEC1899'd,0,0,0);
  format date_var datetime20.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Oct 2019 15:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Excel-Values-change-in-SAS/m-p/594474#M13142</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-07T15:01:16Z</dc:date>
    </item>
  </channel>
</rss>

