<?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: Import Excel with where condition for date using SAS DI in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510611#M1992</link>
    <description>That may also result in a really messy log....</description>
    <pubDate>Mon, 05 Nov 2018 21:32:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-11-05T21:32:10Z</dc:date>
    <item>
      <title>Import Excel with where condition for date using SAS DI</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510538#M1974</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to import an excel file with a where condition saying pull only col a with dateformat .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example : I have a table with 3 columns as follows&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Col A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Col B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Col C&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;23/11/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; Cars&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;24/10/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; Buses&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Null&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 600&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;When I import the above table into sas, I need to pull in data where Col A is non-empty and Col A has only dates.&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile =filepath 
out=work.input (where=(Not Missing(A) &amp;amp; A=date9.)) 
dbms=xlsx replace;
getnames=No;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Can someone suggest best way to do this.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks in advance all the help you provide &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 18:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510538#M1974</guid>
      <dc:creator>ashna</dc:creator>
      <dc:date>2018-11-05T18:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel with where condition for date using SAS DI</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510546#M1977</link>
      <description>&lt;P&gt;PROC IMPORT might not be the right way to do this, because it imports data guessing the rows. It may sometimes read date values as character.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First import the data and then using a datastep or proc then modify your dataset. Since you have 'Null' as value I guess SAS will import that field as character. Convert the character to numeric and SAS will identify the format mentioned and gives missing if not valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile =filepath 
out=work.input
dbms=xlsx replace;
getnames=No;
run;


data work.input;
set work.input(rename=(A=A_));
A=input(A_,ddmmyy10.); /* Which are not in ddmmyy format will have missing values */
if not missing(A);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Nov 2018 18:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510546#M1977</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-05T18:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel with where condition for date using SAS DI</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510611#M1992</link>
      <description>That may also result in a really messy log....</description>
      <pubDate>Mon, 05 Nov 2018 21:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-Excel-with-where-condition-for-date-using-SAS-DI/m-p/510611#M1992</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-05T21:32:10Z</dc:date>
    </item>
  </channel>
</rss>

