LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 29 May 2008 16:02:03 -0500
Reply-To:     "data _null_," <datanull@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "data _null_," <datanull@GMAIL.COM>
Subject:      Re: Excel Import Question
Comments: To: "Treder, David" <dtreder@geneseeisd.org>
In-Reply-To:  <AC8B27AA4545474BB8F063FDFE5F2C5503FBF1FF@GISDSERV03.geneseeisd.local>
Content-Type: text/plain; charset=ISO-8859-1

This does PROC IMPORT code gen for the XLS files in a directory. Other methods might be more appropriate.

filename ft35f001 'path to xls files(directory name)'; filename ft35f002 temp; data _null_; file ft35f002; length path command datafile out $256; path = pathname('FT35f001'); command = catx(' ','dir /b',cats(quote(trim(path)),'\*.xls')); infile dummy pipe filevar=command end=eof; do until(eof); input; putlog _infile_; datafile = catx('\',path,_infile_); out = scan(_infile_,1,'.'); put 'PROC IMPORT'; put +3 DATAFILE=:$quote300.; put +3 OUT= 'DBMS=excel;'; put +3 'run;'; end; run; %inc ft35f002 / source2;

On 5/29/08, Treder, David <dtreder@geneseeisd.org> wrote: > > > > > Is there a way to import multiple excel files from a single folder, as > one can do with "*" in an infile statement? Something like: > > > > PROC IMPORT > > DATAFILE= 'c:\datafile\*.xls' > > OUT = a1 > > DBMS=excel ; > > run; quit; > > > > (which, of course, doesn't work) > > > > Thanks for any suggestions, > > Dave > > > > Scanned by GenNET AV out >


Back to: Top of message | Previous page | Main SAS-L page