<?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: Proc Import changes excel date to sasdate in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206787#M15511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might try &lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/67382/HTML/default/viewer.htm#n0msy4hy1so0ren1acm90iijxn8j.htm"&gt;RANGE= instead&lt;/A&gt; -- recommended in the documentation for DBMS=XLSX.&amp;nbsp;&amp;nbsp; Also, if your columns are going to have nontraditional names like "Jan-14" (with the hyphen, you'll have to set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;options validvarname=any;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run the import step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 19:55:30 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2015-03-20T19:55:30Z</dc:date>
    <item>
      <title>Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206783#M15507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have an excel file (XLSX) with 72 columns representing month (i.e. Jan-14, Feb-14, etc).&amp;nbsp; When I use proc import, the column header changes to sasdate:&amp;nbsp; jan-14 = 41640, etc. How can I get PROC IMPORT to show Jan-14, etc as the column header/variable? Here is my code: Proc Import Datafile="&amp;amp;xlsx./projecttracking.xlsx" Out=others DBMS=xlsx Replace; Sheet='Data_Others'; Getnames=Yes; DATAROW=2; MIXED=Yes; GuessingRows=32797; Run; Also, I am unable to use DATAROW in the code above.&amp;nbsp; Is DATAROW not compatible with DBMS=XSLX? Thank yoU!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206783#M15507</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2015-03-20T15:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206784#M15508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I copy/paste my code from sas to notepad/MS word/used the "Advanced Editor" function on this website and none displays my code as I intended it to.&amp;nbsp; Rather it's in sentence structure. What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206784#M15508</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2015-03-20T15:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206785#M15509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's how I add code to a post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In SAS Enterprise Guide, right-click on a code selection and select &lt;STRONG&gt;Copy HTML Source to Clipboard&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- In the message editor here, click &lt;STRONG&gt;HTML&lt;/STRONG&gt; from the toolbar&lt;/P&gt;&lt;P&gt;- In the HTML view, find a snug spot after a &amp;lt;p&amp;gt;&amp;lt;/p&amp;gt; tag combo.&lt;/P&gt;&lt;P&gt;- Paste content&lt;/P&gt;&lt;P&gt;- Quick! Select &lt;STRONG&gt;Show&lt;/STRONG&gt; &lt;STRONG&gt;Full editor&lt;/STRONG&gt; again before your eyes bleed from the crazy HTML coding you see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;Proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;Import&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Datafile&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"&amp;amp;xlsx./projecttracking.xlsx"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; &lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=others &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;DBMS&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=xlsx &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Replace&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Sheet&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'Data_Others'&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Getnames&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=Yes;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;DATAROW&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;MIXED&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=Yes;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;GuessingRows&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;32797&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;Run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206785#M15509</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-03-20T15:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206786#M15510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chris!&amp;nbsp; I copied your suggestion over to my 'cheat sheet". Now that Chris has put my code in an easier to read format: 1.&amp;nbsp; I have an excel file (XLSX) with 72 columns representing month (i.e. Jan-14, Feb-14, etc).&amp;nbsp; When I use proc import, the column header changes to sasdate:&amp;nbsp; jan-14 = 41640, etc. How can I get PROC IMPORT to show Jan-14, etc as the column header/variable? 2.&amp;nbsp; I am unable to use DATAROW in the code above.&amp;nbsp; Is DATAROW not compatible with DBMS=XSLX?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206786#M15510</guid>
      <dc:creator>jen123</dc:creator>
      <dc:date>2015-03-20T15:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206787#M15511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might try &lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/67382/HTML/default/viewer.htm#n0msy4hy1so0ren1acm90iijxn8j.htm"&gt;RANGE= instead&lt;/A&gt; -- recommended in the documentation for DBMS=XLSX.&amp;nbsp;&amp;nbsp; Also, if your columns are going to have nontraditional names like "Jan-14" (with the hyphen, you'll have to set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;options validvarname=any;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run the import step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 19:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206787#M15511</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-03-20T19:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206788#M15512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have you attempted to just format as a date object; and format how you like after doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc print data=work.a;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format data mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 18:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206788#M15512</guid>
      <dc:creator>comatt1</dc:creator>
      <dc:date>2015-03-24T18:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import changes excel date to sasdate</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206789#M15513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest that you do something in Excel to store character strings for your column headers instead of formatted numbers.&lt;/P&gt;&lt;P&gt;As an example I made a small sheet with 4 columns 'ID', 'Jan-15', 'Feb-15' and 2015-03-15 formatted to display as Mar-15.&lt;/P&gt;&lt;P&gt;Here is the result from PROC IMPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;269&amp;nbsp; proc import datafile='c:\downloads\date_example.xlsx'&lt;/P&gt;&lt;P&gt;270&amp;nbsp;&amp;nbsp; dbms=xlsx&lt;/P&gt;&lt;P&gt;271&amp;nbsp;&amp;nbsp; out=example&lt;/P&gt;&lt;P&gt;272&amp;nbsp;&amp;nbsp; replace&lt;/P&gt;&lt;P&gt;273&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;274&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable Name Change.&amp;nbsp; Jan-15 -&amp;gt; Jan_15&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable Name Change.&amp;nbsp; Feb-15 -&amp;gt; Feb_15&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable Name Change.&amp;nbsp; 42078 -&amp;gt; _42078&lt;/P&gt;&lt;P&gt;NOTE: The import data set has 1 observations and 4 variables.&lt;/P&gt;&lt;P&gt;NOTE: WORK.EXAMPLE data set was successfully created.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.06 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you cannot fix then read the column headers from the metadata (or PROC CONTENTS output) and convert to what ever format you want and generate a RENAME statement to change the variable names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select catx('=',name,substr(put(input(substr(name,2),8.)+'01JAN1900'd-2,date9.),3))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :rename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from contents&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where name like '^_%' escape '^'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 20:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-Import-changes-excel-date-to-sasdate/m-p/206789#M15513</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-03-24T20:57:57Z</dc:date>
    </item>
  </channel>
</rss>

