| Date: | Fri, 27 Mar 2009 07:52:36 -0700 |
| Reply-To: | Richard <rdevenezia@WILDBLUE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Richard <rdevenezia@WILDBLUE.NET> |
| Organization: | http://groups.google.com |
| Subject: | Re: Exporting external files... |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
On Mar 27, 6:56 am, priyanka.priyankasi...@GMAIL.COM (Priyanka Singh)
wrote:
> Hi all,
>
> I want to read and import multiple external files (raw data) in SAS. The
> folder from which I want to read and import has all files written in
> structured way. How Should I proceed for it.
Use the operating system wildcard symbol to concatenate the files for
reading.
Here is a windows sample:
------------------------------
%let path = %sysfunc(pathname(WORK));
data _null_;
do n = 1 to 9;
output_filename = cats("&path.\mydata",n,'.dat');
file dynamic filevar=output_filename;
do i = 0 to 9;
x = n*10+i;
put x;
end;
end;
run;
data mydata;
length input_filename $200;
infile "&path.\mydata*.dat" filename=input_filename;
input x;
source = input_filename;
run;
------------------------------
Richard A. DeVenezia
http://www.devenezia.com
|