<?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: how to import excel file when its having date at the end in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214136#M39518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I tried using a * as wildcard in the DATAFILE option for a delimited file it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let path=%sysfunc(pathname(work)) ;&lt;/P&gt;&lt;P&gt;proc export data=sashelp.class file="&amp;amp;path\class.txt" dbms=dlm replace ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc import out=class datafile="&amp;amp;path\clas*.txt" dbms=dlm replace ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2015 12:56:16 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-05-13T12:56:16Z</dc:date>
    <item>
      <title>how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214134#M39516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day all,&lt;/P&gt;&lt;P&gt;I am facing the problem with importing excel file through macros.&lt;/P&gt;&lt;P&gt;the excel name is&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAExport 2015-05-04-12-18-52&lt;/P&gt;&lt;P&gt;the file is coming every week monday. so i created macro for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%LET TODAY1=%SYSFUNC(TODAY(),DATE9.);&lt;/P&gt;&lt;P&gt;%LET LAST_WEEK=%SYSFUNC(INTNX(WEEK,"&amp;amp;TODAY1."D,-1,B),DATE9.);&lt;/P&gt;&lt;P&gt;%LET LAST_WEEK_MONDAY=%SYSFUNC(INTNX(DAYS,"&amp;amp;LAST_WEEK."D,1),YYMMDDD10.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here I didn't&amp;nbsp; create macro for time. The file contains time at the end.&lt;/P&gt;&lt;P&gt;Up to&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;DATAExport 2015-05-04 this i can automate using macro.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;proc import datafile="D:\emp\&lt;SPAN style="font-size: 13.3333330154419px;"&gt;DATAExport &amp;amp;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LAST_WEEK_MONDAY..xls"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;but what my requirement is what ever the time it is consider only Date. and ignore &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;How to import this excel file. the time is changes from file to file. So i can't importing it successfully.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214134#M39516</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-05-13T12:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214135#M39517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you can build the name up to the date, make a directory listing with the wildcard "*" and then use the name you find; this of course assumes that there'e only one file per day.&lt;/P&gt;&lt;P&gt;This would probably easiest with&lt;/P&gt;&lt;P&gt;filename oscmd pipe "ls filename&amp;amp;date.*.xls";&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile oscmd;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;* you may do some checks here to avoid problems if no file is found;&lt;/P&gt;&lt;P&gt;call symput('xls_filename',trim(_infile_));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can't do that (NOXCMD), then this could be helpful: &lt;A href="http://www.wuss.org/proceedings12/55.pdf" title="http://www.wuss.org/proceedings12/55.pdf"&gt;http://www.wuss.org/proceedings12/55.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214135#M39517</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-13T12:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214136#M39518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I tried using a * as wildcard in the DATAFILE option for a delimited file it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let path=%sysfunc(pathname(work)) ;&lt;/P&gt;&lt;P&gt;proc export data=sashelp.class file="&amp;amp;path\class.txt" dbms=dlm replace ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc import out=class datafile="&amp;amp;path\clas*.txt" dbms=dlm replace ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 12:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214136#M39518</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-13T12:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214137#M39519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not able to understand you both said.&lt;/P&gt;&lt;P&gt;using filename and data _null_ how the import it is done. is it dataset after importing saved to any library.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 13:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214137#M39519</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-05-13T13:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214138#M39520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you know that there is only one file with that day of week and some unknown time of day in the filename then use a WILDCARD in the filename and SAS and the operating system will find the file without you needing to know the name.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 13.3333330154419px; background-color: #ffffff;"&gt;proc import datafile="D:\emp\&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; background-color: #ffffff;"&gt;DATAExport &amp;amp;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px;"&gt;LAST_WEEK_MONDAY*.xls"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-style: inherit; background-color: #ffffff; font-family: 'courier new', courier; font-weight: inherit;"&gt;&amp;nbsp; data=last_week_monday replace &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-style: inherit; background-color: #ffffff; font-family: 'courier new', courier; font-weight: inherit;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is possible that there is more than one such file then this method might not work. You will need to test what it does if there are more than one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 13:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214138#M39520</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-13T13:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214139#M39521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC IMPORT OUT= data_1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE=&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em; font-family: 'courier new', courier; background-color: #ffffff;"&gt;"D:\emp\&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em; font-family: 'courier new', courier; background-color: #ffffff;"&gt;DATAExport &amp;amp;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;LAST_WEEK_MONDAY*.xls"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=EXCEL REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Connect: Failure creating file.&lt;/P&gt;&lt;P&gt;ERROR: Error in the LIBNAME statement.&lt;/P&gt;&lt;P&gt;Connection Failed.&amp;nbsp; See log for details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 13:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214139#M39521</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-05-13T13:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to import excel file when its having date at the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214140#M39522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well that's too bad.&amp;nbsp; The LIBNAME statement is not as smart as the INFILE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; TODAY1=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(TODAY(),DATE9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%LET&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; LAST_WEEK_MONDAY=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%SYSFUNC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(INTNX(WEEK.2,"&amp;amp;TODAY1."D,-1,B),&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt; line-height: 1.5em; background-color: white;"&gt;YYMMDDD10.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;=TODAY1 &amp;amp;=&amp;amp;LAST_WEEK_MONDAY;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; filename $&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;256&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"D:\emp\DATAExport &amp;amp;LAST_WEEK_MONDAY*.xls"&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=filename obs=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'FILENAME'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,filename);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;datafile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;filename"&lt;/SPAN&gt; &lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;....&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 13:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-import-excel-file-when-its-having-date-at-the-end/m-p/214140#M39522</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-13T13:58:03Z</dc:date>
    </item>
  </channel>
</rss>

