<?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 Imports into SAS from Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534552#M146693</link>
    <description>&lt;P&gt;The usual message for fixing all your woes:&lt;/P&gt;
&lt;P&gt;save the data to csv, and read it with a custom data step where&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt; have total control over variable names, attributes and how the content is read. In&amp;nbsp;&lt;U&gt;one&lt;/U&gt; step.&lt;/P&gt;
&lt;P&gt;The Excel file format is useless for data transfer.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Feb 2019 17:58:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-02-11T17:58:02Z</dc:date>
    <item>
      <title>Date Imports into SAS from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534543#M146686</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am using the below code to import the excel file with date.&lt;/P&gt;&lt;P&gt;proc import file="&amp;amp;FM.\01Source\IMG YTD &amp;amp;IDBYear..xlsx"&lt;BR /&gt;OUT=EQ (keep=A--I)&lt;BR /&gt;DBMS=XLSX REPLACE;&lt;BR /&gt;SHEET="&amp;amp;IDBYear. - YTD";&lt;BR /&gt;GETNAMES=NO;&lt;BR /&gt;MIXED=NO;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data rwork.EQ (drop=A--I);&lt;BR /&gt;set EQ;&lt;/P&gt;&lt;P&gt;/*Delete unwanted columns*/&lt;BR /&gt;if B="" then delete;&lt;BR /&gt;if C="" then delete;&lt;BR /&gt;if upcase(C) in ("MARKET","") then delete;&lt;/P&gt;&lt;P&gt;format TRANSdate mmddyy10.;&lt;BR /&gt;format old_polno $13.;&lt;BR /&gt;format MARKET $10.;&lt;BR /&gt;format clientnme $50.;&lt;BR /&gt;format transamt dollar10.2;&lt;BR /&gt;format new_polno $13.;&lt;BR /&gt;&lt;BR /&gt;TRANSdate = input(compress(A), mmddyy10.);&lt;BR /&gt;old_polno = input(compress(B), $13.);&lt;BR /&gt;market = input(compress(C), $10.);&lt;BR /&gt;clientnme = input(compress(D), $50.);&lt;BR /&gt;transamt = input(compress(E), dollar10.2);&lt;BR /&gt;new_polno = input(compress(I), $13.);&lt;/P&gt;&lt;P&gt;if transamt in (0, .) then delete;&lt;BR /&gt;if new_polno in (0, .) then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after importing through proc import, its showing as number like sas Days format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;imported Excel Format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1/11/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/15/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/16/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/16/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/17/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/22/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/24/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/30/2019&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;but when i look into the EQ dataset(second datastep) its showing null(attached screenshot)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 17:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534543#M146686</guid>
      <dc:creator>sg_kr</dc:creator>
      <dc:date>2019-02-11T17:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date Imports into SAS from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534552#M146693</link>
      <description>&lt;P&gt;The usual message for fixing all your woes:&lt;/P&gt;
&lt;P&gt;save the data to csv, and read it with a custom data step where&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt; have total control over variable names, attributes and how the content is read. In&amp;nbsp;&lt;U&gt;one&lt;/U&gt; step.&lt;/P&gt;
&lt;P&gt;The Excel file format is useless for data transfer.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 17:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534552#M146693</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-11T17:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date Imports into SAS from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534553#M146694</link>
      <description>&lt;P&gt;Excel works just fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find that if I bring in a date as text I can then validate it and convert it. So bring transdate in as $10. and then use these examples:&lt;BR /&gt;&lt;BR /&gt;case when Date_Received is not missing and input(Date_Received,best10.) is missing then 'bad received date' else 'clean' end as invalid5,&lt;BR /&gt;&lt;BR /&gt;/* convert from excel date to SAS date */&lt;BR /&gt;input(Date_Received,best10.)-21916 as Received_Dt format date9.,&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 18:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534553#M146694</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2019-02-11T18:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date Imports into SAS from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534558#M146697</link>
      <description>&lt;P&gt;Your attachment doesn't appear (yet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS DELETE as you are using it removes entire rows, not columns. Perhaps that is the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But better would be to read a CSV with more control than to "fix" things caused by the limited guessing ability of Proc Import as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;suggests.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 18:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Imports-into-SAS-from-Excel/m-p/534558#M146697</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-11T18:42:01Z</dc:date>
    </item>
  </channel>
</rss>

