<?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 Reg:Upload data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Upload-data/m-p/17864#M3447</link>
    <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I will be getting data daily in excel ,the data is placed in the server and the excel is placed on the each day folder like,10/02/2011,11/02/2011&lt;BR /&gt;
the excel structure is the same for each day now i want to automate it and create sasdataset with the dates ex :Daily_10/02/2011 like that. how can i move from one folder to another folder</description>
    <pubDate>Tue, 21 Jun 2011 11:19:33 GMT</pubDate>
    <dc:creator>sas_</dc:creator>
    <dc:date>2011-06-21T11:19:33Z</dc:date>
    <item>
      <title>Reg:Upload data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Upload-data/m-p/17864#M3447</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I will be getting data daily in excel ,the data is placed in the server and the excel is placed on the each day folder like,10/02/2011,11/02/2011&lt;BR /&gt;
the excel structure is the same for each day now i want to automate it and create sasdataset with the dates ex :Daily_10/02/2011 like that. how can i move from one folder to another folder</description>
      <pubDate>Tue, 21 Jun 2011 11:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Upload-data/m-p/17864#M3447</guid>
      <dc:creator>sas_</dc:creator>
      <dc:date>2011-06-21T11:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Upload data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Upload-data/m-p/17865#M3448</link>
      <description>Give you an example.&lt;BR /&gt;
The code search all the sub-directory under c:\temp\ and convert xls file into csv file at respective sub-directory.&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
filename _xls pipe 'dir c:\temp\*.xls /s';&lt;BR /&gt;
data xls_file;&lt;BR /&gt;
 infile _xls length=len;&lt;BR /&gt;
 input whole $varying200. len;&lt;BR /&gt;
 retain directory;&lt;BR /&gt;
 length file_name $ 200;&lt;BR /&gt;
 if strip(whole) eq: 'c:\temp' then directory=scan(whole,1,' ');&lt;BR /&gt;
  else if  scan(whole,-1,'.') eq 'xls' then do;&lt;BR /&gt;
                                             _name=scan(trim(whole),-1,' ');&lt;BR /&gt;
                                             file_name=catx('\',directory,_name);&lt;BR /&gt;
                                             output;&lt;BR /&gt;
                                             end; &lt;BR /&gt;
 &lt;BR /&gt;
 keep file_name;&lt;BR /&gt;
run;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 set xls_file nobs=num_obs;&lt;BR /&gt;
 call symputx(cats('path',_n_),file_name);&lt;BR /&gt;
 call symputx(cats('name',_n_),scan(file_name,-2,'.\'));&lt;BR /&gt;
 call symputx('nobs',num_obs);&lt;BR /&gt;
run;&lt;BR /&gt;
%put _user_;&lt;BR /&gt;
options mprint mlogic symbolgen; &lt;BR /&gt;
%macro xls_to_csv;&lt;BR /&gt;
%do i=1 %to &amp;amp;nobs;&lt;BR /&gt;
 proc import datafile="&amp;amp;&amp;amp;path&amp;amp;i" out=&amp;amp;&amp;amp;name&amp;amp;i dbms=excel replace;&lt;BR /&gt;
                                              getnames=yes;&lt;BR /&gt;
                                              mixed=yes;&lt;BR /&gt;
                                              run;&lt;BR /&gt;
 proc export data=&amp;amp;&amp;amp;name&amp;amp;i outfile="%scan(&amp;amp;&amp;amp;path&amp;amp;i,1,'.').csv " dbms=csv replace;run;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend ;&lt;BR /&gt;
&lt;BR /&gt;
%xls_to_csv&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 22 Jun 2011 02:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Upload-data/m-p/17865#M3448</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-22T02:09:05Z</dc:date>
    </item>
  </channel>
</rss>

